Socket
Socket
Sign inDemoInstall

graphql-http-ws-client

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphql-http-ws-client

### Node.js with HTTP and WS links


Version published
Weekly downloads
75
increased by114.29%
Maintainers
1
Weekly downloads
 
Created
Source

GraphQL client over HTTP/WS

import createGraphQLClient from "graphql-http-ws-client";
import gql from "graphql-tag";
import WebSocket from "ws";
import fetch from "node-fetch";

const { client } = createGraphQLClient("MY_GRAPHQL_URL", {
	websocket: WebSocket,
	fetch: fetch
});
import createGraphQLClient from "graphql-http-ws-client";
import gql from "graphql-tag";
import fetch from "node-fetch";

const { client } = createGraphQLClient("MY_GRAPHQL_URL", {
	fetch: fetch,
	createWebsocketLink: false
});
import createGraphQLClient from "graphql-http-ws-client";
import gql from "graphql-tag";
import WebSocket from "ws";
import fetch from "node-fetch";

const { client } = createGraphQLClient("MY_GRAPHQL_URL", {
	websocket: WebSocket,
	createHTTPLink: false
});
import WebSocket from "ws";
import fetch from "node-fetch";
import createGraphQLClient from "graphql-http-ws-client";
import gql from "graphql-tag";    
import { persistCache } from "apollo-cache-persist";

const { client, cache } = createGraphQLClient("MY_GRAPHQL_URL");

const waitOnCache = persistCache({
	cache: cache,
	storage: window.localStorage
});

waitOnCache.then(() => {
	ReactDOM.render(
		<ApolloProvider client={client}>
			<Router>
				<App/>
			</Router>
		</ApolloProvider>,
		document.getElementById('root')
	)
});

FAQs

Package last updated on 10 Dec 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc