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
I'm running into two issues when trying to use Zeus with React Query and TypeScript in a React Native mobile app
Problem 1
When running zeus schema.graphql ./ --reactQuery (from the directory where the schema.graphql exists) , according to the documentation, it should generate a reactQuery.ts file from which we can import useTypedQuery. However, when I run that command, it does not seem to generate that file
I have "graphql-zeus": "^5.3.2", as a dependency in my package.json file
Am I missing something?
Problem 2
With the generated files (index.ts and const.ts), I'm unable to receive strong type safety.
For example, here's a simple schema (schema.graphql):
Hello :)
I'm running into two issues when trying to use Zeus with React Query and TypeScript in a React Native mobile app
Problem 1
When running
zeus schema.graphql ./ --reactQuery
(from the directory where theschema.graphql
exists) , according to the documentation, it should generate areactQuery.ts
file from which we can importuseTypedQuery
. However, when I run that command, it does not seem to generate that fileI have
"graphql-zeus": "^5.3.2",
as a dependency in mypackage.json
fileAm I missing something?
Problem 2
With the generated files (
index.ts
andconst.ts
), I'm unable to receive strong type safety.For example, here's a simple schema (
schema.graphql
):Using
useQuery
fromreact-query
, this works well:However, with the below, I don't get type safety (i.e. it does not complain that
thisIsAnInvalidProp
is not a valid parameter for the query)Is there a way to enable strong type safety?
Note: This is a quick code sample and is not the actual schema I'm working with. Truly appreciate any help here, happy to answer any questions :)
The text was updated successfully, but these errors were encountered: