Zaid-Ajaj / Snowflaqe

A dotnet CLI to generate type-safe GraphQL clients for F# and Fable with automatic deserialization, static query verification and type checking
MIT License
154 stars 25 forks source link

GraphQLParser.dll is missing from Snowflaqe.Tasks nugget package #77

Closed andriilula closed 3 weeks ago

andriilula commented 1 year ago

When I try to build a client as a separate project, I'm getting the following error:

error MSB4018: System.IO.FileNotFoundException: Could not load file or assembly 'GraphQLParser, Version=8.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified. 

My .fsproj file:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
  </PropertyGroup>

  <PropertyGroup>
    <SnowflaqeProjectName>Test.Client</SnowflaqeProjectName>
    <SnowflaqeQueriesFolder>../../graphql</SnowflaqeQueriesFolder>
    <SnowflaqeSchemaPath>../../graphql/schema.json</SnowflaqeSchemaPath>
    <SnowflaqeTargetProjectType>fsharp</SnowflaqeTargetProjectType>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="FSharp.SystemTextJson" Version="1.*" />
    <PackageReference Include="Snowflaqe.Tasks" Version="1.*">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
  </ItemGroup>
</Project>

To me it seems like some packaging issue, but I'm new to F#, so maybe I'm doing something wrong. Please advice.

Thank you!

xperiandri commented 1 year ago

@Zaid-Ajaj looks like something bad happened when you packed Tasks project

andriilula commented 1 year ago

One more thing that I've noticed. I was able to successfully generate a client using cli and confirm that it works with our API. But the client that was generated using Snowflaqe.Tasks the client fails to recognize some types that worked in cli generated client. I also see that Snowflaqe.Tasks nuget is 3 months older than Snowflaqe.

Zaid-Ajaj commented 1 year ago

@andriilula Indeed Snowflaqe.Tasks is a bit behind the CLI. Please keep using the CLI for the time being as it is the "official" way to use Snowflaqe. The MSBuild tasks have been an odd child in this repo

@Zaid-Ajaj looks like something bad happened when you packed Tasks project

@xperiandri I don't know to be honest. I will have a look into it when time permits

xperiandri commented 1 year ago

@Zaid-Ajaj we extensively use MSBuild tasks I think https://github.com/Zaid-Ajaj/Snowflaqe/issues/78 will solve the issue and you will release both automatically Right?

andriilula commented 1 year ago

@Zaid-Ajaj Thanks for the quick reply!

The reason we want to use Snowflaqe.Tasks is that it allow us to generate a client in an interactive notebook (.dib) without installing additional dependencies. When we use cli we need to install snowflaqe in order to use it.

Zaid-Ajaj commented 1 year ago

@andriilula I see, that is a very interesting use case for sure!

@xperiandri #78 can solve the problem indeed, I remember the build failing locally when I tried to publish a package and didn't know where to go from there. I will take another look soon

Zaid-Ajaj commented 1 year ago

Hi @andriilula I know it has been a while since I looked into this issue. I was able to publish Snowflaqe.Tasks v1.4.5 latest without any issues, can you give it a try for your use case?

xperiandri commented 3 weeks ago

It works, we can close. @Zaid-Ajaj thanks!