byme8 / ZeroQL

C# GraphQL client with Linq-like syntax
MIT License
278 stars 13 forks source link

CS0138 and CS0234 errors when trying to build #114

Closed ziomek64 closed 1 month ago

ziomek64 commented 1 month ago

Describe the bug

I'm getting CS0138 on the start - "using namespace" can be only used towards namespaces. Element "Json" is a type not namespace.

Then I'm getting CS0234 on the whole thing. Stuff like Type or namespace "GraphQLTypeAttribute" doesn't exist in the namespace of "MyNamespace.ZeroQL"

Not sure if it's' the API i'm using is not compatible or what but I cannot get it work. If you'd like to test then this is a public API - https://graphql.anilist.co

Also while at it is it possible to turn off auto generation on each build? I'd like to implement INotifyPropertyChanged on the classes. If not possible I guess I'll have to map them to my own ones. But it would be great if it was possible to derive from interfaces in the future. INotifyPropertyChanged is heavily required on any UI application in .NET.

byme8 commented 1 month ago

You have skipped the following section during bug creation. It would be nice to have it. It will definitely help with investigation.

Environment (please complete the following information):

byme8 commented 1 month ago

I have tried to reproduce the issue with the 7.0.0-preview.5 version and everything compiles as expected. I don't see any issues.

The error itself signals that some core parts of library is missing completely. Are you sure that you installed the CLI tool and nuget package correctly?

ziomek64 commented 1 month ago

When I followed exactly your CLI steps it worked. Idk why I couldn't get it to work on existing one. Works good, the learning curve is there definitely. Seems weird at first. Is there a possibility for me to edit classes somehow without regeneration?

byme8 commented 1 month ago

Is there a possibility for me to edit classes somehow without regeneration?

The generated classes main goal is to help to define the GraphQL query. They are not intended as the DTO objects. As a result, there is not way to edit them.