I am currently using:
- Neo4J version 4.2
- Apollo server
- GraphQL and @neo4j/graphql (to auto-generate Neo4J types from
schema.graphql
) - Expo React Native with Apollo Client
- TypeScript
I wanted to create TypeScript types for my GraphQL queries by following the steps outlined in this guide.
The default setup of apollo-cli searches within the ./src
folder, but in React Native, all files are located in the root directory. So, when attempting to modify the includes
configuration for Apollo client as follows:
<root>/apollo.config.js
module.exports = {
client: {
includes: ['**/*.{ts,tsx}'],
},
};
After executing:
> apollo codegen:generate --endpoint=http://localhost:4001/ --target=typescript --tagName=gql
The output was an error:
Error: Error initializing Apollo GraphQL project "Unnamed Project": Error: Error in "Loading queries for Unnamed Project": Error: ️️There are multiple definitions for the `OpName` operation. Please rename or remove all operations with the duplicated name before continuing.