apollographql / apollo-tooling

✏️ Apollo CLI for client tooling (Mostly replaced by Rover)
https://apollographql.com
MIT License
3.04k stars 467 forks source link

apollo-language-server@1.26.9 breaks codegen on Windows #2636

Open adrienharnay opened 2 years ago

adrienharnay commented 2 years ago

Intended outcome:

Operations are detected in the project like before.

Actual outcome:

After updating apollo-language-server (sub-dep of apollo) from 1.26.8 to 1.26.9, on Windows the following error message appears:

× Generating query files with 'typescript' target
    → No operations or fragments found to generate code for.
    Error: No operations or fragments found to generate code for.

How to reproduce the issue:

Versions

apollo@2.33.11 apollo-language-server@1.26.9

Thanks in advance!

trevor-scheer commented 2 years ago

Thanks for the report @adrienharnay. This repo is largely unmaintained (I'm the only one and it's very low on our list of priorities). I would entertain a PR that resolved the problem for you, but it's unlikely I'll get around to fixing this myself.

We don't intend to support codegen going forward. I'll point you to this issue and recommend migrating to graphql-code-generator. https://github.com/apollographql/apollo-tooling/issues/2614

Zikoat commented 1 year ago

You have to change backslashes to forwardslashes in the apollo client:codegen command. This can be done using normalize-path package if you are running this command through js.

See other issue i created: #2667