forked from hasura/graphql-engine
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide default empty object for empty model 'args' field (hasura#1154)
<!-- The PR description should answer 2 important questions: --> ### What If a model has arguments, but they are all provided by presets, then previously we would require users to pass an empty `args: {}` argument like this: ```graphql query MyQuery ActorsByMovieMany(args: {}) { actor_id movie_id name } } ``` There is no need for this, so this PR loosens this restriction, by providing a default empty value. This means users can also do the above query with: ```graphql query MyQuery ActorsByMovieMany { actor_id movie_id name } } ``` Because both versions now work, this is a non-breaking change. ### How Instead of just looking at number of arguments in schema generation, consider which have been prefilled and provide a default empty value if there is nothing a user could pass anyway. V3_GIT_ORIGIN_REV_ID: cf184e42a114df782e1480a8f19548dda31e5992
- Loading branch information
1 parent
601771c
commit 0e93e22
Showing
4 changed files
with
91 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,9 @@ query MyQuery { | |
movie_id | ||
name | ||
} | ||
noargs: ActorsByMovieMany { | ||
actor_id | ||
movie_id | ||
name | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters