Apollo-tooling: Fragments-only set of files are not supported

Created on 11 Nov 2018  Â·  1Comment  Â·  Source: apollographql/apollo-tooling

Hi,

When trying to generate types for a set of files that only contains fragments, apollo client:codegen fails with

Error: No document sets found to generate code for.

I suppose that it's related to the following line in apollo/lib/commands/client/codegen.js:

if (!operations.length) {
  throw new Error("No document sets found to generate code for.");
}

As a workaround I can add any query and then codegen works

Most helpful comment

I'm also getting this error and my project has various queries and mutations:

Was able to generate with version 1.9.2 (files/schema attached)

but with version 2.0.17 I get the error:
✔ Loading Apollo Project
✖ Generating query files with 'typescript' target
→ No document sets found to generate code for.
Error: No document sets found to generate code for.
at write (/usr/local/lib/node_modules/apollo/lib/commands/client/codegen.js:59:39)
at Task.task (/usr/local/lib/node_modules/apollo/lib/commands/client/codegen.js:84:46)

files.zip

schema.json.zip

>All comments

I'm also getting this error and my project has various queries and mutations:

Was able to generate with version 1.9.2 (files/schema attached)

but with version 2.0.17 I get the error:
✔ Loading Apollo Project
✖ Generating query files with 'typescript' target
→ No document sets found to generate code for.
Error: No document sets found to generate code for.
at write (/usr/local/lib/node_modules/apollo/lib/commands/client/codegen.js:59:39)
at Task.task (/usr/local/lib/node_modules/apollo/lib/commands/client/codegen.js:84:46)

files.zip

schema.json.zip

Was this page helpful?
0 / 5 - 0 ratings

Related issues

u-ashish picture u-ashish  Â·  4Comments

ericbiewener picture ericbiewener  Â·  4Comments

gordanhappy picture gordanhappy  Â·  3Comments

reichhartd picture reichhartd  Â·  4Comments

clayne11 picture clayne11  Â·  3Comments