Closed NicolasRouquette closed 5 years ago
The github schema defines a scalar type: URI
.
With graphqlCodegenImports += "java.net.URI"
, I get errors because there is no circe decoder available.
Perhaps this could be remedied with another import.
For the time being, the simplest is to handle URI
just like ID
, i.e., as an alias to String
.
I understand your intention, but adding types from a specific schema into the generic code generation is IMHO not good solution as this may break others that actually have a valid URI
type and types for it.
What should work is the following
package com.github.graphql
object types {
type URI = String
}
in your build.sbt
graphqlCodegenImports += "com.github.graphql.types._"
WDYT?
Closing this. We shouldn't add magic behaviour for random types. If there's a better way to handle these scenarios than the current options, I'm open for suggestions and pull requests :)
Thanks for your pull request :hugs:
Is this a custom type in your code base? If so then you should solve this by importing the required types with
graphqlCodegenImports
. See https://github.com/muuki88/sbt-graphql#scalar-types