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

inventoryLevelItems example for GraphQL #1159

Open
czupet opened this issue Feb 27, 2025 · 0 comments
Open

inventoryLevelItems example for GraphQL #1159

czupet opened this issue Feb 27, 2025 · 0 comments

Comments

@czupet
Copy link

czupet commented Feb 27, 2025

There is the listProducts example for GraphQL and I got it to work in my application, but now I need help with InventoryLevel.
Do you have an example of how to retrieve inventoryLevel?

Here's my code, but I am getting error (undefinedField: Field 'inventoryLevels' doesn't exist on type 'QueryRoot')

var graphRequest = new GraphRequest
{
Query = """
query inventoryLevelItems($limit: Int!, $id: ID!) {
inventoryLevels(first: $limit, id: $id) {
id
inventoryLevels(first: 10) {
edges {
node {
id
location {
id
name
}
quantities(names: ["available"]) {
name
quantity
}
}
}
}
}
}
""",
Variables = new Dictionary<string, object>
{
{"limit", 10},
{"id", itemId}
}
};

public record ListInventoryLevelItemsResult
{
[StringSyntax("GraphQL")]

public required InventoryLevelConnection InventoryLevelItems { get; set; } = new();

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants