Limiting create options for model relationships #379
-
When you have a relationship of models, for example: user -> favorites, the auto generated resolvers give you the createOneFavorite right? and this mutation allow you to assign a user, you can do it by:
this means you can create new users and assign them the new favorite record, what if you would only to allow the connect type in this mutation instead of allowing to also create, is that possible? or I would have to extend the class and add some kind of validation and rejection when those options are used? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
It's not possible yet: |
Beta Was this translation helpful? Give feedback.
-
I solved it by https://github.com/multipliedtwice/graphql-query-purifier Moved .gql files in git submodule, shared it between backend and frontend. Over querying from what is allowed in .gql files will be dropped at the moment request lands on resolver |
Beta Was this translation helpful? Give feedback.
It's not possible yet:
#326