Last active
March 7, 2019 10:20
-
-
Save AlecAivazis/09f6a1a0ad9a5b2f3eb7ba486bf8c8f2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApolloLink } from 'apollo-link' | |
import { Observable } from 'apollo-link-core' | |
import { graphql } from 'graphql' | |
import { print } from 'graphql/language/printer' | |
import schema from './schema' | |
const blockChainLink = new ApolloLink( | |
(operation) => new Observable(observer => { | |
graphql(schema, print(operation.query), null, null, operation.variables) | |
.then(result => { | |
observer.next(result) | |
observer.complete() | |
}) | |
}) | |
) | |
// ... everything else... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment