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

Question regarding auto-generating Graph schema & types in FE #230

Open
Tim-Maes opened this issue May 16, 2022 · 1 comment
Open

Question regarding auto-generating Graph schema & types in FE #230

Tim-Maes opened this issue May 16, 2022 · 1 comment

Comments

@Tim-Maes
Copy link

We're using a graph-api-generator library to generate all types in the frontend.
Queries always return a result -never null- and we have Angular 13 with strict typing.

When we generate the types, the outputTypes are generated as Type | null | undefined or Type | any.

I wonder if there is a way in backend to indicate non-null results (as in NonNull for input) ? If there is, how? :)

Thanks

@tlil
Copy link
Collaborator

tlil commented May 17, 2022

Do you mean something like this?

public NonNull<string> NonNullablePrimitiveField(NonNull<string> nonNullablePrimitiveArg) => /* ... */;

from test/GraphQL.Conventions.Tests/Adapters/ArgumentResolutionTests.cs :-)

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