I am able to create schema.json with below command
apollo schema:download --endpoint http://localhost:4000 schema.json
I have directory structure as below
package.json
schema.json
src
queries.js
mutations.js
My graphql queries and mutations are stored in queries.js and mutations.js. when I run the below command I get an error. I have tried several variations but nothing works.
apollo codegen:generate --schema schema.json --target flow --queries src/*.js
Error:
› Error: For TypeScript and Flow generators, "output" must be empty or a single directory name, unless
› the "outputFlat" flag is set.
Below command worked.
apollo codegen:generate --queries="./src/**/*.js" --schema="./schema.json" --target="typescript"
That exact command yields the same error for me. Attempting to provide the "output" parameter per the documentation:
apollo codegen:generate --queries="./src/**/*.ts" --schema=./schema.json --target=typescript __generated__
throws:
Error: Unexpected argument: __generated__
Same as @jonlambert
Most helpful comment
That exact command yields the same error for me. Attempting to provide the "output" parameter per the documentation:
throws: