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
A quick fix for those affected by this change is to add enable_inflection: true to the dev.yml config file or if you're using GraphJin as a library set conf.EnableInflection = true on the config object.
What changed and why
GraphJin until now allowed for table names in plural and singular as a way to signal if you wanted the response to be an object or an array. For example using the selector name product would return a single product as a JSON object {} while using products would return a JSON array of objects [{}].
While this could be useful it was confusing for a lot of folks new to GraphQL or GraphJin as well as for those dealing in non-english table names. We've decided to deprecate this functionality quickly and move to a more standard GraphQL. Now all queries will return a JSON array of objects except for queries using an id argument products(id: $id) and table names will no longer be singular or plural they will be only be whatever the table name is.
An exceptions to this are when the compiler knows based on the database relationship that we can only ever return a single object then we will return a JSON object. Additionally you can use the @object directive to force the response to be a JSON object.
Motivation
Firstly we take breaking changes very seriously and have done our best to not introduce any. In this case we made an exception. GraphJin has a lot of new adopters and we don't want to deal with dealing with backward compatibility at this point as the overhead for that will slow us down. We are at an exciting stage of the project with lots of new very useful functionality added at good pace I don't want to hurt that in any way.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Quick Fix:
A quick fix for those affected by this change is to add
enable_inflection: true
to thedev.yml
config file or if you're using GraphJin as a library setconf.EnableInflection = true
on the config object.What changed and why
GraphJin until now allowed for table names in plural and singular as a way to signal if you wanted the response to be an object or an array. For example using the selector name
product
would return a single product as a JSON object{}
while usingproducts
would return a JSON array of objects[{}]
.While this could be useful it was confusing for a lot of folks new to GraphQL or GraphJin as well as for those dealing in non-english table names. We've decided to deprecate this functionality quickly and move to a more standard GraphQL. Now all queries will return a JSON array of objects except for queries using an
id
argumentproducts(id: $id)
and table names will no longer be singular or plural they will be only be whatever the table name is.An exceptions to this are when the compiler knows based on the database relationship that we can only ever return a single object then we will return a JSON object. Additionally you can use the
@object
directive to force the response to be a JSON object.Motivation
Firstly we take breaking changes very seriously and have done our best to not introduce any. In this case we made an exception. GraphJin has a lot of new adopters and we don't want to deal with dealing with backward compatibility at this point as the overhead for that will slow us down. We are at an exciting stage of the project with lots of new very useful functionality added at good pace I don't want to hurt that in any way.
Migrating your GraphQL
Original Query
New Query
Beta Was this translation helpful? Give feedback.
All reactions