-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
buildClientSchema, introspection result missing interfaces #1207
Comments
it looks like you need to build a full schema, rather than a schema with a specific type. you'll need to define the base operation types first, thus the error also maybe you are looking for https://github.com/graphql/graphql-js? this is the graphiql monorepo for the web IDE and official graphql lsp tooling |
@acao thank you for looking at my issue. I removed the line which redefines types so that the entire schema is being used (schema is requested using this query btw)
The same error still occurs, even when the full schema is used. I'll take a look at graphql-js. My end goal is to customize query and mutation behaviour for test components using addMockFunctionsToSchema, in a way that is similar to the somewhat dated blog post here. |
indeed, the graphql slack is actually a great place for support on this issue, or the apollo spectrum. again this really isnt in our wheelhouse, so im helping as a peer because i dont maintain this code, though I help them review Prs sometimes. we also use the official |
its confusing i know, the repo names, but the |
@acao I am in the slack general channel and have pasted a link there to this github issue |
Ok, I’ve been sick and havent used a laptop today, but I might hop on later tonight and may be able to get around to helping you with this issue? usually the slack channel is quite helpful, as is the apollo spectrum channel. |
but off the cuff, I think you'd only have this bug regarding |
@acao thank you I will try a few things out using your insight |
@acao again thank you for your assistance. I tried using a utility file to make the introspection query and it seems to have resolved this issue, const introspectionQuery = require( 'graphql/utilities/introspectionQuery' ).introspectionQuery;
// used in the query as `query: introspectionQuery` The schema which is returned has more definition that the previous schema I'll close this ticket later today when I'm further along |
yep that sound about right! that const will be deprecated in soon to be released 15 since its dynamic now, i’d suggest using: const { getIntrospectionQuery } = require(‘graphql/utilities/introspectionQuery’)
// and then
query: getIntrospectionQuery() |
@acao :) thank you |
I haven't quite resolved this issue and am seeing errors related to scalar values needed in the responses. {
"message": "GraphQL error: No mock defined for type \"UUID\""
} This graphql/graphql-js issue might be related? @acao if you are available do you have any ideas for things I might try as a solution? |
This looks very related ardatan/graphql-tools#545 The service originating the schema relies on dozens of complex scalar values. It seems graphql-tools may not be suited for mocking services that use custom scalar values... |
I found that all of the queries values must be returned and must not be |
I'm trying to use graphql's
buildClientSchema
to generate a schema that can be used for mocking/testing components as seen in this link.This error is thrown and I'm un-sure how to proceed,
To try and simplify the situation, I've modified the schema slightly for now to define one type.
and the following is the error result,
The service originating the schema and the sources calling buildClientSchema are using graphql version 14.5.8.
I would be glad if someone would tell what I'm doing wrong and would welcome any solution.
The text was updated successfully, but these errors were encountered: