Search code examples
c#intellisensevisual-studio-2019graphql-dotnet

GraphQL .NET Core Visual Studio 2019 wrong suggestions


I'm practicing with graphql-dotnet. I created a PropertyQuery as follows:

public class PropertyQuery : ObjectGraphType
{
    public PropertyQuery(IPropertyRepository propertyRepository)
    {
        Field<ListGraphType<PropertyType>>(
            "properties",
            resolve: context => propertyRepository.GetAll()
        );

        Field<PropertyType>(
            "property"
            , arguments: new QueryArguments(new QueryArgument<IntGraphType> { Name = "id" })
            , resolve: context => propertyRepository.GetById(context.GetArgument<int>("id"))
         );
    }
}

Problem occurred with intellisense of Visual Studio (2019). When I passed resolve parameter of Field method, the intellisense not suggests GetArgument or Source etc... of ResolveFieldContext<TSource>, instead, it suggests like:

enter image description here

I am confused whether this is a error of visual studio, or the graphql-dotnet library has a problem. I'm a newbie in graphql, and if intellisense suggestions is wrong, I can't continue to practice


Solution

  • I am confused whether this is a error of visual studio, or the graphql-dotnet library has a problem.

    There's possibility that this is one issue with VS2019 since same project in VS2017 works well...

    I can now reproduce same issue in my machine. Since this issue occurs only when we use VS2019 to develop the project with Graphql package, I think it could be one issue about VS2019 Intellisense. (Create and develop the project in VS2017, all works well. Open it in VS2019, the issue occurs)

    So I've just reported this issue in DC forum as a workaround. Here is the link where you can track it. Please visit the link and vote on the issue so you can get notifications on progress. Hope it makes some help :)