2 ms·
In the implementation of GraphQL I work with I find that I end up making giant string mutations/queries that I can't use any sort of intellisense for - it's jus
by SketchySeaBeast 5y ago
In the implementation of GraphQL I work with I find that I end up making giant string mutations/queries that I can't use any sort of intellisense for - it's just guessing and checking with running the queries. Is there a better way to get more than passing back a really long string?
- dtech 5y agoI use IntelliJ, in our setup it gives complete checking and autocomplete. YMMV It sounds to me like you could benefit from some kind of codegen [1] to generate native language code out of graphql and checking the queries at compile/build-time instead of runtime. GraphQL playground [2] might be a lower-investment tool to help you. [1] In JS/TS GraphQL code generator is the standard: https://www.graphql-code-generator.com/ https://www.graphql-code-generator.com/ Other languages have similar tools. [2] https://github.com/graphql/graphql-playground https://github.com/graphql/graphql-playground
- quonn 5y agoOn the client, use the gql tag, a GraphQL code generator to generate TypeScript types from the gql tagged queries and the appropriate editor/linter tooling. Then everything is checked when building or directly in the editor.