You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To maintain compatibility with the design of ember-cli-mirage-graphql (the Ember-specific library that came before this), Mirage GraphQL automatically filters records by variables when auto-resolving. I think this behavior is probably surprising to most and I'm not sure if it's actually useful.
Example of the behavior being useful:
query Products($size: String) {
products(size: $size) {
id
name
size
}
}
The query is called with a $size variable having the value "XL" and only records that match are returned from Mirage's database.
Example of the behavior being painful (forcing a query to be manually resolved):
query Products($limit: Int) {
products(limit: $limit) {
id
name
}
}
The query is called with a $limit variable having the value 10 and Mirage GraphQL tries to auto-resolve this by filtering for products having a "limit" field with a value of 10. Since "limit" isn't a field, no records are returned.
I'd like to gather some feedback on whether or not to change this behavior and make it off-by-default. I could add a handler creation option to enable this for anyone who does find this behavior useful.
The text was updated successfully, but these errors were encountered:
@jneurock it really makes sense I think the @miragejs/graphql should work as graphQL server works out of the box without need for any resolver or custom functions for that.
To maintain compatibility with the design of
ember-cli-mirage-graphql
(the Ember-specific library that came before this), Mirage GraphQL automatically filters records by variables when auto-resolving. I think this behavior is probably surprising to most and I'm not sure if it's actually useful.Example of the behavior being useful:
The query is called with a $size variable having the value "XL" and only records that match are returned from Mirage's database.
Example of the behavior being painful (forcing a query to be manually resolved):
The query is called with a $limit variable having the value 10 and Mirage GraphQL tries to auto-resolve this by filtering for products having a "limit" field with a value of 10. Since "limit" isn't a field, no records are returned.
I'd like to gather some feedback on whether or not to change this behavior and make it off-by-default. I could add a handler creation option to enable this for anyone who does find this behavior useful.
The text was updated successfully, but these errors were encountered: