ConstraintString type appeared in graphql schema on the client
See original GitHub issueConstraintString leaked through introspection. Is it by design? This makes GraphiQL unhappy.
Error: Invalid or incomplete schema, unknown type: ConstraintString. Ensure that a full introspection query is used in order to build a client schema.
ConstraintString can be revealed by the following query:
query Introspection {
__schema {
types {
name
inputFields {
type {
name
}
}
}
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:34 (19 by maintainers)
Top Results From Across the Web
GraphQL validation using directives
ConstraintString & ConstraintNumber will never appear within your Schema Definition Language (SDL), and the client/consumer needn't be ...
Read more >Schemas and Types - GraphQL
Character is a GraphQL Object Type, meaning it's a type with some fields. Most of the types in your schema will be object...
Read more >Five Common Problems in GraphQL Apps (And How to Fix ...
Schema duplication; Server/client data mismatch ... But of course, a GraphQL schema can also have custom types: User , Comment , Event ,...
Read more >Securing a GraphQL API by using a client ID - IBM
If you select the Secure using Client ID option when creating a GraphQL proxy API ... that have been attached to the types...
Read more >GraphQL | RedwoodJS Docs
Unlike a REST API, a GraphQL Client performs operations that allow gathering a ... Finally, the GraphQL schema is associated with a resolvers...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I ran across this issue trying to solve a similar issue in a custom directive I created. My situation was slightly different, but I came up with a solution that could work for this issue as well. It would require an update to the directive and I’m not sure how/if it would affect non-Apollo users.
The issue is that a new type is being created in the directive schema visitor, but the type is not being added to the schema type map. For example, https://github.com/confuser/graphql-constraint-directive/blob/master/index.js#L54. If the type is not added to the schema type map, then the above mentioned error “Incomplete or Invalid schema…” will occur when Playground introspects the schema.
The following could be a possible solution. This example could be simplified since the new type is known to be either ConstraintStringType or ConstraintNumberType, but I left it a bit more generic for anyone else who might run across this issue. Note, isNamedType and isWrappingType is imported from ‘graphql’.
A possible solution could be to modify the wrapType function:
UPD: ignore the below. The directive stopped working. 😃 UPD2: If you’d remove the two scalars below it will make the directive work, but will break client side retrospection. So, choose your destiny. 😃
I found a workaround! Omg, took a while.
Add this to your
.graphql
schema file (if you have one though):