Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fragments-only set of files are not supported #684

Closed
wasd171 opened this issue Nov 11, 2018 · 1 comment · Fixed by #707
Closed

Fragments-only set of files are not supported #684

wasd171 opened this issue Nov 11, 2018 · 1 comment · Fixed by #707
Assignees

Comments

@wasd171
Copy link

wasd171 commented Nov 11, 2018

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

@Gerrel
Copy link

Gerrel commented Nov 13, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants