We have a DB with data in, which we can query via DQL in Ratel. When we try to run the same query in graphql, via the /graphql
endpoint, we get no data. We upserted the data via the /mutate
endpoint
Here’s a truncated type we are trying to query:
type ImagingDataset {
hasIdentifier: String! @id
hasComment: String
}
The DQL query in Ratel that returns data:
{
qry(func: eq(ImagingDataset.hasIdentifier, "2a860ed6-f795-298e-6206-9a8b844142de")) {
ImagingDataset.hasIdentifier
}
}
The GraphQL query, against the /graphql
endpoint, that doesn’t work, is below. I’ve also tried this query with filters and tried the getImagingDataset(hasIdentifier: "2a860ed6-f795-298e-6206-9a8b844142de")
query too.
query {
queryImagingDataset {
hasIdentifier
}
}
Which returns:
{
"data": {
"queryImagingDataset": []
},
"extensions": {
"tracing": {
"version": 1,
"startTime": "2021-02-25T20:17:20.084260535Z",
"endTime": "2021-02-25T20:17:20.086433454Z",
"duration": 2172924,
"execution": {
"resolvers": [
{
"path": [
"queryImagingDataset"
],
"parentType": "Query",
"fieldName": "queryImagingDataset",
"returnType": "[ImagingDataset]",
"startOffset": 122758,
"duration": 2032037,
"dgraph": [
{
"label": "query",
"startOffset": 186831,
"duration": 1938102
}
]
}
]
}
}
}
}
We have found if we mutate data against /graphql
, then the GraphQL query works. We work at a large organization that wants to use standard GraphQL for all enterprise APIs, so we really need the /graphql
endpoint to work