question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid Schema for optional field arguments on interface implementations

See original GitHub issue

Version and Environment Details

Operation system: OSX

IDE name and version: WebStorm 2020.1 EAP

Plugin version: 2.4.0

Expected Behaviour

interface Vehicle {
  name: String!
}

type Car implements Vehicle {
  name(charLimit: Int = 10): String!
}

This was, at one point, an invalid schema, but it was made valid 5 years ago. https://github.com/graphql/graphql-spec/pull/110 https://github.com/graphql/graphql-spec/issues/401

Actual Behaviour

graphql.schema.validation.InvalidSchemaException: invalid schema:
object type 'Car' does not implement interface 'Vehicle' because field 'name' has a different number of arguments
	at graphql.schema.GraphQLSchema$Builder.buildImpl(GraphQLSchema.java:536)
	at graphql.schema.GraphQLSchema$Builder.build(GraphQLSchema.java:515)
	at graphql.schema.idl.SchemaGenerator.makeExecutableSchemaImpl(SchemaGenerator.java:294)
	at graphql.schema.idl.SchemaGenerator.makeExecutableSchema(SchemaGenerator.java:271)
	at graphql.schema.idl.SchemaGenerator.makeExecutableSchema(SchemaGenerator.java:243)
	at graphql.schema.idl.UnExecutableSchemaGenerator.makeUnExecutableSchema(UnExecutableSchemaGenerator.java:28)
	at com.intellij.lang.jsgraphql.schema.GraphQLTypeDefinitionRegistryServiceImpl.lambda$getSchemaWithErrors$1(GraphQLTypeDefinitionRegistryServiceImpl.java:72)
	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1705)
	at com.intellij.lang.jsgraphql.schema.GraphQLTypeDefinitionRegistryServiceImpl.getSchemaWithErrors(GraphQLTypeDefinitionRegistryServiceImpl.java:69)
	at com.intellij.lang.jsgraphql.ide.project.schemastatus.GraphQLConfigSchemaNode.<init>(GraphQLConfigSchemaNode.java:82)
	at com.intellij.lang.jsgraphql.ide.project.schemastatus.GraphQLSchemasRootNode.getChildren(GraphQLSchemasRootNode.java:48)
	at com.intellij.lang.jsgraphql.ide.project.schemastatus.GraphQLSchemasPanel.lambda$null$0(GraphQLSchemasPanel.java:128)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:869)
	at com.intellij.lang.jsgraphql.ide.project.schemastatus.GraphQLSchemasPanel.lambda$null$1(GraphQLSchemasPanel.java:125)
	at com.intellij.util.RunnableCallable.call(RunnableCallable.java:20)
	at com.intellij.util.RunnableCallable.call(RunnableCallable.java:11)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.call(ApplicationImpl.java:255)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

It does look like it’s straight from the library so I’ll create an issue there as well. https://github.com/graphql-java/graphql-java/issues/1932

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
CarsonFcommented, Jun 1, 2020

Working great! Thanks for the quick release 💯

1reaction
jimkyndemeyercommented, May 30, 2020

Fixed in 2.5.0, pending JetBrains approval.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Covariance of arguments not possible for interface ... - GitHub
Then I define a Sculpture implementation. I want Scuplture to be filtered on material and school , but also based on all the...
Read more >
Federation error codes - Apollo GraphQL Docs
Indicates that a schema provided for an Apollo Federation supergraph is not a valid supergraph schema.
Read more >
How can I infer optional properties in TypeScript?
Given a schema-like T , first map over each of its properties and pull out the first parameter to the validate() method.
Read more >
Handbook - Interfaces - TypeScript
Notice that our object actually has more properties than this, but the compiler only checks that at least the ones required are present...
Read more >
GraphQL specification
Fragments are consumed by using the spread operator ( ... ). All fields selected by the fragment will be added to the query...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found