0
私はハイブリッドアプローチを働かせることができますが、すべてのグラフ操作がソケット上で行われる完全なwebsocketトランスポートを使いたいと思います。私はまったく彼らのdocumentationが好きでした。Apollo Client Full WebSocket Transportが私にエラーthis.networkInterface.queryが関数ではありません
import { SubscriptionClient } from 'subscriptions-transport-ws'
import ApolloClient from 'apollo-client'
import gql from 'graphql-tag'
const client = new SubscriptionClient('ws://localhost:5000/graphql', { reconnect: true })
const apolloClient = new ApolloClient({ networkInterface: client })
apolloClient.query({
query: gql`query { app }`
})
は私にエラーを与える:
Uncaught (in promise) Error: Network error: this.networkInterface.query is not a function
at new ApolloError (ApolloError.js:34)
at QueryManager.js:325
at QueryManager.js:818
at Array.forEach (<anonymous>)
at QueryManager.js:815
at Array.forEach (<anonymous>)
at QueryManager.broadcastQueries (QueryManager.js:812)
at QueryManager.js:281
at <anonymous>