You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, using introspection via a query to a URL, data is being returned but is failing to load
Digging into the code I can see that data is being passed to the @graphql-tools method
getSchemaFromIntrospection(introspectionResult, options)
where introspectionResult = {"data":{"__schema":{ ...... }}}
I see that the code is looking for introspectionResult.data i.e.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, using introspection via a query to a URL, data is being returned but is failing to load
Digging into the code I can see that data is being passed to the @graphql-tools method
getSchemaFromIntrospection(introspectionResult, options)
where introspectionResult =
{"data":{"__schema":{ ...... }}}
I see that the code is looking for introspectionResult.data i.e.
function getSchemaFromIntrospection(introspectionResult, options) { var _a, _b; if ((_a = introspectionResult === null || introspectionResult === void 0 ? void 0 : introspectionResult.**data**) === null || _a === void 0 ? void 0 : _a.__schema) { return graphql.buildClientSchema(introspectionResult.data, options); } else if ((_b = introspectionResult === null || introspectionResult === void 0 ? void 0 : introspectionResult.errors) === null || _b === void 0 ? void 0 : _b.length) { console.log('introspectionResult.errors: ', introspectionResult.errors); if (introspectionResult.errors.length > 1) { const combinedError = new utils.AggregateError(introspectionResult.errors, 'Could not obtain introspection result'); throw combinedError; } const error = introspectionResult.errors[0]; throw error.originalError || error; } else { throw new Error('Could not obtain introspection result, received: ' + JSON.stringify(introspectionResult)); } }
but introspectionResult.data is undefined
Any tips on what i need to to do get it to recognise introspectionResult.data? Other graphql tools seem to recoginise the introspection result
Beta Was this translation helpful? Give feedback.
All reactions