Skip to content

Add Variables in filter Query #396

@santhidhanuskodi23

Description

@santhidhanuskodi23

Hi,

I would like to know how I can I implement variables passing to the query.
An example query below

query GetClientsByName($clientName: string){
clients(filter: "clientName == $clientName")
{
hasNextPage
hasPreviousPage
items {
clientCode
clientName
}
totalItems
}
}

I have written a very simple wrapper .net core api using entity graphql.
services.AddGraphQLSchema(provider =>
{
provider.OnFieldCreated = (field) =>
{
if (field.ReturnType.IsList && field.ReturnType.SchemaType.GqlType == GqlTypes.QueryObject && !field.FromType.IsInterface)
{
field.UseFilter().UseSort().UseOffsetPaging(defaultPageSize: DefaultPageSize, maxPageSize: MaxPages);
}
};
});

How Can I modify the current app to include variables support? Any sample application or google links?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions