|
In the GraphQL query below, is there a way to not use the "items" identifier and use my own. So the first example I'd want to be "parts" and the second one "locations". |
Answered by
yorek
Oct 2, 2023
Replies: 1 comment
|
Hi BumpaRoy It is not possible to change to name query {
customers {
contacts: items {
CustomerID
Title
FirstName
LastName
EmailAddress
}
}
}would return the following result: {
"data": {
"customers": {
"contacts": [
{
"CustomerID": 1,
"Title": "Mr.",
"FirstName": "Orlando",
"LastName": "Gee",
"EmailAddress": "orlando0@adventure-works.com"
}
]
}
}
} |
0 replies
Answer selected by
seantleonard
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Hi BumpaRoy
It is not possible to change to name
itemsto something else in the GraphQL query, but if you need to have theitemselement using another name in the returned result, you can use aliasing to do that. For example:would return the following result:
{ "data": { "customers": { "contacts": [ { "CustomerID": 1, "Title": "Mr.", "FirstName": "Orlando", "LastName": "Gee", "EmailAddress": "orlando0@adventure-works.com" } ] } } }