Last active
August 17, 2018 12:34
-
-
Save aswinmprabhu/61829a0197e48f227651b33b64d1d8e2 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 { | |
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