graphql-tag
graphql-tag copied to clipboard
gql literal VS .graphql files (what is the recommended way?)
Hello everyone,
I have a graphql API that I'm querying using javascript.
I have a gql.js
file in which I write graphql queries using string literals.
I'm planning to write some services in Python in the future that will need to query the same graphql API as my javascript clients, and ideally I'd like to re-use the gql queries (sitting in the gql.js
file currently).
What is the recommended approach? Should I write all my queries in .graphql
file instead, so that I can reuse them among multiple languages (I'm looking at JS and Python mainly)?
Thanks a lot for your advices!
Any updates?
Any updates ?
use .gql or .graphql files