vtex / typescript

VTEX's TypeScript tools, style guide and best practices
MIT License
55 stars 7 forks source link

How GraphQL queries args are defined #49

Open rerissondaniel opened 4 years ago

rerissondaniel commented 4 years ago

What is to be discussed? The way our arguments for graphql queries are defined.

Describe the solution you'd like I would like a solution that allowed me to perform as little as possible breaking changes while extending the query arguments and also that made a cleaner code in frontend and also generated types that could be used to type my graphql backend easily, since most custom types that are used in these apps are from its schema.

I Suggest using that input types should be wrapped in an object, to make such addition easier. I've also seen this suggestion in other blog posts, but with names that I can't remember right now (maybe in airbnb directives, I'll update this issue as I remember them) It also provides clearer declaration of queries in front end, as explained in this blog post.

How we do this today? We just add the parameters as the requisites change. I've had to add a new argument to a query and this was my workflow:

Example: addition of filters arg, in https://github.com/vtex/catalog-graphql/pull/169/files

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is a discussion thread, the most voted option will be final. Thank you for your contributions.