Skip to content
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

jackson deserialisation error #895

Closed
mmaryo opened this issue Oct 2, 2020 · 1 comment
Closed

jackson deserialisation error #895

mmaryo opened this issue Oct 2, 2020 · 1 comment
Labels
type: bug Something isn't working

Comments

@mmaryo
Copy link

mmaryo commented Oct 2, 2020

Hello

Library Version
Kotlin 1.4.0
Quarkus 1.8.1.Final
graphql-kotlin 4.0.0-alpha.4

Describe the bug
There is a bug while deserialize response with Jackson

To Reproduce

There an exemple in the repo https://github.com/mmaryo/test-graphql-kotlin

This is a simple Graphql

type Query {
    pairs: [Pair!]!
}
query UniswapPairTop100Query {
    pairs {
        id
    }
}
type Pair {
    id: ID!
}

And the code
(run the classe in test folder)

val client = (URL(apiUrl))
runBlocking {
    val pairsTop100 = uniswapClient.pairsTop100()
    println(pairsTop100)
}

And the result

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Strange Map type java.util.Map: cannot determine type parameters
 at [Source: (String)"{"errors":[{"locations":[{"line":1,"column":1}],"message":"Unexpected `type[Name]`\nExpected `{`, `query`, `mutation`, `subscription` or `fragment`"}]}"; line: 1, column: 1]

	at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:62)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.buildBeanDeserializer(BeanDeserializerFactory.java:227)
	at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:143)
	at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:414)

@mmaryo mmaryo added the type: bug Something isn't working label Oct 2, 2020
@dariuszkuc
Copy link
Collaborator

Sounds like an issue with Jackson -> see quarkusio/quarkus#11549, FasterXML/jackson-module-kotlin#356 and #850

Try explicitly downgrading Jackson to 2.11.1 that might help.

Closing as duplicate of #850

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Development

No branches or pull requests

2 participants