1.1.1 • Published 5 years ago

apollo-link-electron-ipc v1.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

apollo-link-electron-ipc

In electron, forward GraqhQL operations to the main process

NPM Version

Install

npm i -S apollo-link-electron-ipc

Usage

// in main
import { createElectronRPCGraphQLRequestExecutor } from 'apollo-link-electron-ipc';
import { HttpLink } from 'apollo-link-http';
import fetch from 'electron-fetch';

// example with HttpLink
createElectronRPCGraphQLRequestExecutor({
  link: new HttpLink({
    uri: 'your-endpoint',
    fetch
  })
});


// in renderer
import { createElectronRPCLink } from 'apollo-link-electron-ipc';
import { ApolloClient } from 'apollo-client';
import { InMemoryCache } from 'apollo-cache-inmemory';

const client = new ApolloClient({
  link: createElectronRPCLink(),
  cache: new InMemoryCache(),
});

client.query(MY_QUERY);

Streaming link

⚠️ apollo-link-electron-ipc supports ObservableQueries with streaming links, but requires to instantiate ApolloClient with option queryDeduplication: false,. See apollographql/apollo-client#4322

License

MIT

1.1.1

5 years ago

1.1.0

5 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.0

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago

0.0.0

6 years ago