graphql-playground icon indicating copy to clipboard operation
graphql-playground copied to clipboard

createApolloLink expects an ApolloClient, not ApolloLink

Open wmertens opened this issue 3 years ago • 0 comments

This issue pertains to the following package(s):

  • [x] GraphQL Playground

latest npm version

according to the docs, createApolloLink should return a Link, but it only works if I return ApolloClient.

I'm trying to use my existing link in my app, so I imported MiddleWareApp directly and then grab the client with useApolloClient.

const client = useApolloClient()
return <MiddleWareApp createApolloLink={()=>client} />

Also, for subscription queries, it doesn't seem to use the provided link?

wmertens avatar Jan 19 '22 18:01 wmertens