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

non-nullable arguments are being inferred as nullable #360

Closed
drowhunter opened this issue Nov 25, 2018 · 2 comments
Closed

non-nullable arguments are being inferred as nullable #360

drowhunter opened this issue Nov 25, 2018 · 2 comments
Milestone

Comments

@drowhunter
Copy link
Contributor

Problem
non-nullable arguments are being inferred as nullable

Given the following class

public class Query
    {
        public Task<User> GetUser(IResolverContext ctx, int id)
        {
            IUserRepository repo = ctx.Service<IUserRepository>();
            return repo.GetAsync(id);
        }
    }

results in the following

user(
    id: Int = null
): User

Expected behavior

user(
    id: Int!
): User

Additional context
The only way for me to specify that id should be non nullable is to override the field
descriptor.Field(f => f.GetUser(default, default)).Argument("id",d => d.Type<NonNullType<IntType>>());

@michaelstaib
Copy link
Member

I will look into that. We have recently added a lot functionality in that area so it might be a regression bug. I will write a test for that and check it out. A fix should be ready Sunday night. Thanks for reporting this issue.

@michaelstaib
Copy link
Member

This one is fixed now with 0.6.7.

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