'GraphQL; select all records
The service provider for an ERP software recently implemented GraphQL for those customers who wish to use their data beyond the tools they provide. I was asked to investigate its usefulness in creating digests of this data into more user-friendly data formats (excel, google sheets, ect ... )
While experimenting with the API using Altair I've run across a situation I don't understand, as I'm approaching the challenge as I would a RDMS:
{
__type(name:"Jobs") {
fields {
name
description
}
}
}
The above returns all the fields for the object 'Jobs'. For this examples, it returns a list of fields: JobNo, PartNo, PartRev, CustomerID, DueDate
I wanted to return a list of existing 'JobNo' in the Jobs object, so I tried the query:
{
Jobs {
JobNo DueDate
}
}
Which resulted in:
{
"errors": [
"Expected a non-null value for argument \"JobNo\" on field \"Jobs\"."
]
}
If I use the following query:
{
Jobs(JobNo:"12345")
{
JobNo DueDate
}
}
I get results, but its not very useful as I would have to know something about the contents of the data.
Is there a way of querying for ALL JobNo? Or is the purpose of GraphQL to know at least some specifics of the data, like the JobNo, before constructing your query?
Thank you.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
