Open drmax24 opened 2 years ago
I need to write a validation to check if id is present in a database table. Is it possible to do it right now?
In the above post https://github.com/overblog/GraphQLBundle/issues/453 validation EntityExists was mentioned:
Mutation: type: object config: fields: createUser: type: "String" resolve: "@=mut('createUser', [args, validator])" args: groups: type: "[String]" userId: type: Int! validation: - EntityExists: App\Entity\User
If i try the above example I have an error:
Constraint class 'Symfony\Component\Validator\Constraints\EntityExists' doesn't exist.
Here is laravel-graphql code for validation if userId exists in a table
class UpdateUserMutation extends Mutation { protected function rules(array $args = []): array { return [ 'id' => ['required', 'integer', 'exists:user,id'], ]; }
Any ideas if I can check ids against table/entity via graphql validator?
I need to write a validation to check if id is present in a database table. Is it possible to do it right now?
In the above post https://github.com/overblog/GraphQLBundle/issues/453 validation EntityExists was mentioned:
If i try the above example I have an error:
Constraint class 'Symfony\Component\Validator\Constraints\EntityExists' doesn't exist.
Here is laravel-graphql code for validation if userId exists in a table
Any ideas if I can check ids against table/entity via graphql validator?