Last active
August 17, 2018 12:34
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 { | |
makeRemoteExecutableSchema, | |
introspectSchema, | |
} from 'graphql-tools'; | |
import fetch from 'node-fetch'; | |
import { HttpLink } from 'apollo-link-http'; | |
// To satisfy Extend peer dependencies | |
import 'apollo-link'; | |
const createRemoteExecutableSchema = async () => { | |
// Create remote executable user schema | |
const userLink = new HttpLink({ | |
uri: 'https://bazookaand.herokuapp.com/v1alpha1/graphql', | |
fetch, | |
}); | |
const userSchema = makeRemoteExecutableSchema({ | |
schema: await introspectSchema(userLink), | |
link: userLink, | |
}); | |
return userSchema; | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment