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.

Initial setup instructions improvement

See original GitHub issue

The wiki states for the the initial setup to add a target in the project file so it’s rebuild every time before compile:

<Target Name="GenerateQLClient" BeforeTargets="BeforeCompile">
    <Exec Command="dotnet zeroql generate --schema .\schema.graphql --namespace TestServer.Client --client-name TestServerGraphQLClient --output Generated/GraphQL.g.cs" />
</Target>

As the generated client is not declared as output it can lead to build issues when the generated file is not existing already. This can be improved by declaring the output of the exec task and adding an item group:

    <Target Name="GenerateQLClient" BeforeTargets="BeforeCompile">
        <Exec Command="dotnet zeroql generate --schema .\schema.graphql --namespace TestServer.Client --client-name TestServerGraphQLClient --output Generated/GraphQL.g.cs" Outputs="Generated/GraphQL.g.cs">
            <Output ItemName="Generated" TaskParameter="Outputs" />
        </Exec>
        <ItemGroup>
            <Compile Include="@(Generated)" />
            <FileWrites Include="@(Generated)" /> <!-- For clean to work properly -->
        </ItemGroup>
    </Target>

Now the generated file doesn’t need to exist when building and also doesn’t have to be committed.

Issue Analytics

  • State:closed
  • Created 3 months ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
byme8commented, Jul 12, 2023

The generated client would be stored inside ./obj/ZeroQL folder. So it will never appear in the solution. However, you still have access to generated classes.

0reactions
byme8commented, Jul 12, 2023

Checkout version 6.0.0-preview.1. I added additional targets to the Nuget package. Now it automatically looks for the ZeroQL config file and executes CLI on the build. Here the full documentation

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Establish a Performance Improvement Plan
Learn how to create a performance improvement plan (PIP). Disciplinary procedure steps and sample action plans are included.
Read more >
How to improve work instruction effectiveness part 1 - YouTube
If you're interested in my 6-step problem solving template, it's available for free through this link: ...
Read more >
How to improve your 'First Time Right' score in 5 steps
In the example of FTR, the manufacturer would: 1. Define the problem with the process. For example, Plant A's low FTR score indicates...
Read more >
How to write a work instruction - simple step-by-step guide
Just start and learn and improve as you go. One idea is to inform your colleagues what you're doing and ask them to...
Read more >
How to Build the Best User Manual
We'll look at what a user manual is, explore the various types you can create, and lay out exactly how to write user...
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