question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GRAPHQLGEN1000 error when referencing a project that uses GraphQlClientGenerator

See original GitHub issue

Hi, I came across a problem when using GraphQlClientGenerator across multiple projects that reference each other. I have a library project that references the GraphQlClientGenerator source generator to generate source files from a schema.json file, this works fine. The problem arises when creating a second projects that references the first library project. When trying to build it, i get this error: GRAPHQLGEN1000: Either "GraphQlClientGenerator_ServiceUrl" parameter or GraphQL JSON schema additional file must be specified.

Now, I could copy the schema.json file to this second project and add the GraphQlClientGenerator_ServiceUrl but this would kind of defeat the purpose of having a single library project and it would also mean that I have to do this for each project that references the first one.

I think the problem is that the GraphQlClientGenerator analyzer is added as a dependency to all projects which reference a project with the analyzer added, which causes the source generator to run when it shouldn’t. Do you think this is fixable or can you think of any workaround ?

Thanks !

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:21 (18 by maintainers)

github_iconTop GitHub Comments

1reaction
SimonCroppcommented, Feb 10, 2021

Btw. why do you want to use manual generation instead of source generator?

we own the graphql service. so as part of the tests, we spin up an instance of the graphql service and gen a client proxy to be consumed by clients.

1reaction
Husqvikcommented, Dec 16, 2020

Seems to be simpler than that. Just mark the generator assets as private:

<PackageReference Include="GraphQlClientGenerator" Version="0.8.*" IncludeAssets="analyzers" PrivateAssets="all" />

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error handling - Apollo GraphQL Docs
Whenever Apollo Server encounters errors while processing a GraphQL operation, its response to the client includes an errors array containing each error ......
Read more >
Generating types from a GraphQL schema
Setting up your project. We'll use the GraphQL Code Generator library to generate types based on our GraphQL schema ...
Read more >
GraphQL error handling to the max with Typescript, codegen ...
We'll see in this article how to: achieve a better error representation than the default offered by GraphQL; get type safety using Typescript ......
Read more >
Failed to load schema from http://localhost:8000/graphql ...
Experiencing the same now. My localhost is serving the GraphiQL interface just fine, showing the correct schema and all, but the code-generator ......
Read more >
API (GraphQL) - Client code generation - AWS Amplify Docs
The amplify codegen types [--nodownload] command generates GraphQL types for Flow and typescript and Swift class in an iOS project. This command ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found