https://kotlinlang.org logo
#http4k
Title
# http4k
a

Arnab Datta

11/19/2020, 12:08 PM
I keep getting the following error when adding
implementation group: "org.http4k", name: "http4k-graphql", version: "3.278.0"
to my
build.gradle
file. Any ideas?
Copy code
Could not find org.http4k:http4k-format-jackson:3.278.0.
d

dave

11/19/2020, 12:14 PM
we need to sync it to maven - can you add jcenter in the meantime?
a

Arnab Datta

11/19/2020, 12:15 PM
Yeah, that works
d

dave

11/19/2020, 12:15 PM
the maven central syncing is really flakey -- not us but sontatype... 🙄
a

Arnab Datta

11/19/2020, 12:17 PM
Somewhat related: https://www.http4k.org/guide/modules/graphql/ references something from
com.expediagroup
What version are you actually using in the example? Do you know? I couldn’t find any references to the version that is used in the example repo
d

dave

11/19/2020, 12:17 PM
aha - sorry
we use the expedia kotlin lib
i'll update it, but check out the example: https://github.com/http4k/examples/tree/master/graphql
a

Arnab Datta

11/19/2020, 12:18 PM
Yes, but which version? 😛
Ah yes ok. Found it now.
Just fyi, version 4.0.0 breaks your example.
d

dave

11/19/2020, 12:26 PM
ah - thanks for letting us know. will check it out
a

Arnab Datta

11/19/2020, 12:32 PM
Nw
Last question: Getting the following for this line of code from your example
Copy code
val gql: GraphQLHandler = JavaHttpClient().asGraphQLHandler(Uri.of("<http://localhost:8000/graphql>"))
Copy code
Cannot access class 'java.net.http.HttpClient'. Check your module classpath for missing or conflicting dependencies
Is there a conflicting import somewhere maybe? Or a conflict in dependencies?
d

dave

11/19/2020, 12:40 PM
are you on Java 8? if so, use Java8HttpClient
also - how does it break the example?
a

Arnab Datta

11/19/2020, 12:42 PM
Aha, yes. Java 8, sadly.
On 4.0.0, there isn’t any export that is
import com.expediagroup.graphql.SchemaGeneratorConfig
I don’t know exactly where that import will be changed, but I know that it isn’t there anymore
Same goes for
import com.expediagroup.graphql.toSchema
d

dave

11/19/2020, 12:43 PM
?
are you on a non-alpha version?
a

Arnab Datta

11/19/2020, 12:43 PM
No, that was the same version I tested…or atleast thought I tested. Strange.
Literally just tried again, and now it works. No clue why it didn’t work before.
d

dave

11/19/2020, 12:45 PM
lol. ok
a

Arnab Datta

11/19/2020, 12:46 PM
Severe case of pebcak I suspect 😂
🤣 1
9 Views