Skip to content
Graffle is a work in progress. Learn more.

Transport Memory

Getting Started

The memory transport works with in-memory schemas. It ultimately invokes execute from the graphql package. This transport is used when you instantiate Graffle with a GraphQLSchema.

ts
import { Graffle } from 'graffle'
import { TransportMemory } from 'graffle/extensions/transport-memory'
import { GraphQLObjectType, GraphQLSchema, GraphQLString } from 'graphql'

const schema = new GraphQLSchema({
  query: new GraphQLObjectType({
    name: `Query`,
    fields: {
      foo: {
        type: GraphQLString,
        resolve: () => `bar`,
      },
    },
  }),
})

const graffle = Graffle.create()
  .use(TransportMemory)
  .transport('memory', { schema })

Released under the MIT License.