apollo-link-lambda
v0.1.0
Published
Lambda transport layer for GraphQL
Downloads
1
Readme
apollo-link-lambda
Installation
yarn add apollo-link graphql apollo-link-lambda
Usage
import { InMemoryCache } from 'apollo-cache-inmemory'
import ApolloClient from 'apollo-client'
import { createLambdaTransport } from 'apollo-link-lambda'
import AWS from 'aws-sdk'
AWS.config.update({ region: 'ap-southeast-2' }) // configure AWS however you want
const lambda = new AWS.Lambda()
const functionName = 'myGraphQlLambda'
const client = new ApolloClient({
link: createLambdaTransport(lambda, functionName),
cache: new InMemoryCache()
})
client.query({
query: MY_QUERY
})
.then(data => {
console.log(data)
})
Changelog
0.1.0
- Initial release
License
Released under the Copyfree Open Innovation License.