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.

There is no scalar implementation for the named 'GraphQLLong' scalar type

See original GitHub issue

I read the docs and did the following:

Gradle:

implementation 'com.graphql-java:graphql-java:15.0' // Also tried v16.1
implementation 'com.graphql-java:graphql-java-extended-scalars:15.0.0'

Java:

import graphql.scalars.ExtendedScalars;
...
newRuntimeWiring()
  .scalar(ExtendedScalars.GraphQLLong)
  .type(...).build();

GraphQL:

scalar GraphQLLong
type Mutation {
  myTest(someValue:GraphQLLong): String
}

And I get the error:

SchemaProblem{errors=[There is no scalar implementation for the named  'GraphQLLong' scalar type]}
graphql.schema.idl.SchemaGenerator.makeExecutableSchema(SchemaGenerator.java:74)
graphql.schema.idl.SchemaGenerator.makeExecutableSchema(SchemaGenerator.java:52)

I notice if I comment out the java lines, it gives me the same error. I verified that the scalar is there via printout of the RuntimeWiring objects getScalars() method.

GraphQLScalarType{name='Long', description='Long type', coercing=graphql.scalars.java.JavaPrimitives$1@5e08b120}

What am I doing wrong?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
dfa1commented, Dec 12, 2020

so if you have:

newRuntimeWiring()
  .scalar(ExtendedScalars.GraphQLLong)
  .type(...).build();

and:

scalar Long
type Mutation {
  myTest(someValue: Long): String
}

you still see the problem?

0reactions
dfa1commented, Dec 18, 2020

@UglyHobbitFeet I would close this bug as there is no bug to fix here 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Graphql java spring boot -- Scalar type error - Stack Overflow
Graphql java spring boot -- Scalar type error -- There is no scalar implementation for the named 'XXX' scalar type ; public class...
Read more >
Scalars | GraphQL Java
A scalar type is meant to represent an indivisible value. The GraphQL specification states that all implementations must have the following scalar types:...
Read more >
Adding Custom Scalars - DGS Framework
It is easy to add a custom scalar type in the DGS framework: Create a class that implements the graphql.schema.Coercing interface and annotate...
Read more >
[solved]-graphql java spring boot -- scalar type error
Coding example for the question Graphql java spring boot -- Scalar type error -- There is no scalar implementation for the named 'XXX'...
Read more >
GraphQL Server Using Spring Boot, Part II — Scalars - Medium
Thus, it is impossible to write a GraphQL operation without scalars being involved. Note: there is no void in GraphQL.
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