Note: This page covers Parcel 1, the documentation for Parcel 2 is being worked on here: v2.parceljs.org

GraphQL

Supported extensions: gql, graphql

You can import directly a graphql file into your code:

# schema.graphql
type Query { hello: String }
import schema from './schema.graphql'

schema is now a GraphQL Document

You can also use imports:

# Foo.graphql
type Foo { bar: String }
# schema.graphql

# import "./Foo.graphql"

type Query { foo: Foo }

Help us improve the docs

If something is missing or not entirely clear, please file an issue on the website repository or edit this page.