graphql실시간 데이터를 받기위해서 http 링크와 웹소켓 링크를 생성 const httpLink = new HttpLink({ uri: ~, credentials: 'omit', }); const wsLink = new WebSocketLink({ uri: ~, options: { lazy: true, reconnect: true, }, webSocketImpl: typeof window === 'undefined' ? ws : undefined, }); const splitLink = split( ({ query }) => { const definition = getMainDefinition(query); return definition.kind === 'OperationDefinition' && definition.operation === 'subscription'; }, wsLink, httpLink ); split()으로 어떤 종류의 작업이 전송되는지에 따라 웹 소켓...
원문 링크 : graphql multiple endpoints