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

Partial fix to detect asynchronous return types within field delegates #3115

Merged
merged 1 commit into from
May 4, 2022

Conversation

Shane32
Copy link
Member

@Shane32 Shane32 commented May 4, 2022

See:

Fixes this scenario, but few others:

Field<CharacterInterface>("hero", resolve: GetDroidByIdAsync);

Task<Droid> GetDroidByIdAsync(IResolveFieldContext<object> context)
    => _data.GetDroidByIdAsync("3");

Exceptions are thrown either during schema construction or schema initialization. Debugging will reveal the faulty line of code.

Note that we could alter this code to accept the delegate and handle it correctly. I elected not to do so, and require users to use the FieldAsync method or correct constructor.

@Shane32 Shane32 self-assigned this May 4, 2022
@github-actions github-actions bot added the test Pull request that adds new or changes existing tests label May 4, 2022
@Shane32 Shane32 requested a review from sungam3r May 4, 2022 14:06
@sungam3r sungam3r added the enhancement New feature or request label May 4, 2022
@Shane32 Shane32 merged commit 001edc3 into master May 4, 2022
@Shane32 Shane32 deleted the partial_fix_3046 branch May 4, 2022 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request test Pull request that adds new or changes existing tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants