Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App doesn't work with nullable reference types in C# 8.0, which affects HotChocolate schema type inference #4

Open
danvanderboom opened this issue Jun 24, 2020 · 1 comment

Comments

@danvanderboom
Copy link

danvanderboom commented Jun 24, 2020

Thanks for building this sample app. It was really helpful in getting up and running with HotChocolate in our Azure Functions app.

The one thing I noticed was in pulling everything into a project with nullable reference types enabled, I got these errors:

HotChocolate.SchemaException: 'Multiple schema errors occured:
The return type of the interface field name does not match the field declared by object type Human. - Type: Human
The return type of the interface field name does not match the field declared by object type Droid. - Type: Droid

There are a few places here and there where I was able to update the schema types to define NonNullTypes (for string and float properties), and to make relationship properties explicitly nullable in the model classes, to get it to work.

@OneCyrus
Copy link
Owner

the example uses the code first approach and not the pure code first yet. so you need to keep the specific types up to date and can't just use nullable reference types. if you want to work with the C# 8.0 nullable type feature, you should use pure code first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants