graphql-dotnet / conventions

GraphQL Conventions Library for .NET
MIT License
233 stars 63 forks source link

Add support for IDataLoaderResult<>, new type from GraphQL 3.0.0 #215

Closed kuzn-ilya closed 3 years ago

kuzn-ilya commented 3 years ago

DataLoaders in GraphQL have been slightly changed in the 3.0.0 release. Now GraphQL expects IDataLoaderResult<> type, which has to be returned from resolvers instead of Task<>. But it seems like GraphQL.Conventions doesn't handle IDataLoaderResult<> properly. For instance, this schema fails:

        private class BugReproQueryDataLoaderResult
        {
            public IDataLoaderResult<string> DataLoaderResult() => new DataLoaderResult<string>("Test");
        }

I believe, that it can be fixed similarly to #187, and I have a working solution, so I can raise a PR for this issue.

tlil commented 3 years ago

Cool - go for it :-)

tlil commented 3 years ago

Thank you, @kuzn-ilya - merged in #216. Will follow up with a release tomorrow. :-)

tlil commented 3 years ago

@kuzn-ilya; now in https://github.com/graphql-dotnet/conventions/releases/tag/v3.3.2