0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Laravel,Graghql,Lighthouseで複数カラムのバリデーション

Posted at

環境

Laravel 6.18.6
lighthouse: 4.11.0

コード

user.graghql
   # 下記の定義はサンプルです。
createUser (
   user_name: String!
   password: String!
): User
app\Graghql\Directives\Validations\createUserValidation.php

    /**
     * @return mixed[]
     */
    public function rules(): array
    {
        return [
            "foo" => [
                new Bar($this->args['bar'])
            ]
        ];
    }

結論

$this->args['foo'];で取れる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?