graphql-import
Last updated a month ago by ardatan .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install graphql-import 
SYNC missed versions from official npm registry.

graphql-import

CircleCI npm version

Import & export definitions in GraphQL SDL (also refered to as GraphQL modules)

There is also a graphql-import-loader for Webpack available.

Install

yarn add graphql-import

Usage

import { importSchema } from 'graphql-import'
import { makeExecutableSchema } from 'graphql-tools'

const typeDefs = importSchema('schema.graphql')
const resolvers = {}

const schema = makeExecutableSchema({ typeDefs, resolvers })

Assume the following directory structure:

.
├── schema.graphql
├── posts.graphql
└── comments.graphql

schema.graphql

# import Post from "posts.graphql"

type Query {
  posts: [Post]
}

posts.graphql

# import Comment from 'comments.graphql'

type Post {
  comments: [Comment]
  id: ID!
  text: String!
  tags: [String]
}

comments.graphql

type Comment {
  id: ID!
  text: String!
}

Running console.log(importSchema('schema.graphql')) produces the following output:

type Query {
  posts: [Post]
}

type Post {
  comments: [Comment]
  id: ID!
  text: String!
  tags: [String]
}

type Comment {
  id: ID!
  text: String!
}

Full documentation

Related topics & next steps

  • Static import step as build time
  • Namespaces
  • Support importing from HTTP endpoints (or Links)
  • Create RFC to add import syntax to GraphQL spec

Prisma

Current Tags

  • 1.0.0-1fc9cdb.0                                ...           alpha (19 days ago)
  • 1.0.0-beta.1                                ...           beta (2 months ago)
  • 1.0.0-beta.2                                ...           latest (a month ago)

272 Versions

  • 1.0.0-1fc9cdb.0                                ...           19 days ago
  • 1.0.0-547e271.0                                ...           19 days ago
  • 1.0.0-b35be4f.0                                ...           22 days ago
  • 1.0.0-c4432f0.0                                ...           22 days ago
  • 1.0.0-7e40e55.0                                ...           23 days ago
  • 1.0.0-31b6366.0                                ...           25 days ago
  • 1.0.0-13f7931.0                                ...           25 days ago
  • 1.0.0-269a259.0                                ...           a month ago
  • 1.0.0-72a8a69.0                                ...           a month ago
  • 1.0.0-25decab.0                                ...           a month ago
  • 1.0.0-ae7b583.0                                ...           a month ago
  • 1.0.0-54de372.0                                ...           a month ago
  • 1.0.0-415f108.0                                ...           a month ago
  • 1.0.0-b6d44f7.0                                ...           a month ago
  • 1.0.0-064dac8.0                                ...           a month ago
  • 1.0.0-1a0386b.0                                ...           a month ago
  • 1.0.0-3d5f2bb.0                                ...           a month ago
  • 1.0.0-fea9f68.0                                ...           a month ago
  • 1.0.0-017e236.0                                ...           a month ago
  • 1.0.0-d2d01a9.0                                ...           a month ago
  • 1.0.0-1cbb16b.0                                ...           a month ago
  • 1.0.0-3da17b9.0                                ...           a month ago
  • 1.0.0-bff5295.0                                ...           a month ago
  • 1.0.0-6beeddf.0                                ...           a month ago
  • 1.0.0-8a50c19.0                                ...           a month ago
  • 1.0.0-4821645.0                                ...           a month ago
  • 1.0.0-a1693e9.0                                ...           a month ago
  • 1.0.0-6fa1b2d.0                                ...           a month ago
  • 1.0.0-ddc9b5a.0                                ...           a month ago
  • 1.0.0-c437192.0                                ...           a month ago
  • 1.0.0-c5a7cac.0                                ...           a month ago
  • 1.0.0-d7edea4.0                                ...           a month ago
  • 1.0.0-c3d4d3c.0                                ...           a month ago
  • 1.0.0-67670da.0                                ...           a month ago
  • 1.0.0-490df7e.0                                ...           a month ago
  • 1.0.0-1606e04.0                                ...           a month ago
  • 1.0.0-9a0b289.0                                ...           a month ago
  • 1.0.0-dc20926.0                                ...           a month ago
  • 1.0.0-54246ce.0                                ...           a month ago
  • 1.0.0-0d74a30.0                                ...           a month ago
  • 1.0.0-b71d480.0                                ...           a month ago
  • 1.0.0-beta.2                                ...           a month ago
  • 1.0.0-4e45d90.0                                ...           a month ago
  • 1.0.0-98af2cf.0                                ...           a month ago
  • 1.0.0-10980c7.0                                ...           a month ago
  • 1.0.0-197a8ed.0                                ...           a month ago
  • 1.0.0-f542e8b.0                                ...           a month ago
  • 1.0.0-b45183e.0                                ...           a month ago
  • 1.0.0-c267420.0                                ...           a month ago
  • 1.0.0-5377fb2.0                                ...           a month ago
  • 1.0.0-be6d939.0                                ...           a month ago
  • 1.0.0-eeabd19.0                                ...           a month ago
  • 1.0.0-f0c5642.0                                ...           a month ago
  • 1.0.0-aea06e7.0                                ...           a month ago
  • 1.0.0-ccb91ec.0                                ...           a month ago
  • 1.0.0-8d6a77e.0                                ...           a month ago
  • 1.0.0-49f5960.0                                ...           a month ago
  • 1.0.0-bfedaf3.0                                ...           a month ago
  • 1.0.0-49e3d43.0                                ...           a month ago
  • 1.0.0-7746b37.0                                ...           a month ago
  • 1.0.0-b9755b9.0                                ...           a month ago
  • 1.0.0-125b0c0.0                                ...           a month ago
  • 1.0.0-a0acd31.0                                ...           a month ago
  • 1.0.0-4f6e2ab.0                                ...           a month ago
  • 1.0.0-e47bc7c.0                                ...           a month ago
  • 1.0.0-cc70dc5.0                                ...           a month ago
  • 1.0.0-dc0715f.0                                ...           a month ago
  • 1.0.0-7b26c7d.0                                ...           a month ago
  • 1.0.0-ef0bb37.0                                ...           a month ago
  • 1.0.0-14d68c8.0                                ...           a month ago
  • 1.0.0-f4e9a9e.0                                ...           a month ago
  • 1.0.0-dc0bf59.0                                ...           a month ago
  • 1.0.0-0f9613b.0                                ...           a month ago
  • 1.0.0-d9ca8b6.0                                ...           a month ago
  • 1.0.0-0a79ed5.0                                ...           a month ago
  • 1.0.0-1e5520e.0                                ...           a month ago
  • 1.0.0-d7d5a35.0                                ...           a month ago
  • 1.0.0-87fdb8c.0                                ...           a month ago
  • 1.0.0-ce4bcd6.0                                ...           a month ago
  • 1.0.0-ac1a2b1.0                                ...           a month ago
  • 1.0.0-dc95d07.0                                ...           a month ago
  • 1.0.0-0e2961c.0                                ...           a month ago
  • 1.0.0-3137967.0                                ...           a month ago
  • 1.0.0-b06a177.0                                ...           a month ago
  • 1.0.0-60e889e.0                                ...           a month ago
  • 1.0.0-aeffe00.0                                ...           a month ago
  • 1.0.0-82c508b.0                                ...           a month ago
  • 1.0.0-a016388.0                                ...           a month ago
  • 1.0.0-eb88ecf.0                                ...           a month ago
  • 1.0.0-79fc4d2.0                                ...           a month ago
  • 1.0.0-f02ce87.0                                ...           a month ago
  • 1.0.0-c89d109.0                                ...           a month ago
  • 1.0.0-b2ce31d.0                                ...           a month ago
  • 1.0.0-cdb3495.0                                ...           a month ago
  • 1.0.0-0c0f0c0.0                                ...           a month ago
  • 1.0.0-8512f4d.0                                ...           a month ago
  • 1.0.0-8ecb458.0                                ...           a month ago
  • 1.0.0-af5c897.0                                ...           a month ago
  • 1.0.0-1f93daa.0                                ...           a month ago
  • 1.0.0-574dfa8.0                                ...           a month ago
  • 1.0.0-4977a97.0                                ...           a month ago
  • 1.0.0-6b49e87.0                                ...           a month ago
  • 1.0.0-e0aceb2.0                                ...           a month ago
  • 1.0.0-6b6767e.0                                ...           a month ago
  • 1.0.0-79b3115.0                                ...           a month ago
  • 1.0.0-509f067.0                                ...           a month ago
  • 1.0.0-e29e50c.0                                ...           a month ago
  • 1.0.0-c63ed1a.0                                ...           a month ago
  • 1.0.0-40d58f4.0                                ...           a month ago
  • 1.0.0-523b837.0                                ...           a month ago
  • 1.0.0-d68b1dc.0                                ...           a month ago
  • 1.0.0-08fa9bd.0                                ...           a month ago
  • 1.0.0-91fdb60.0                                ...           a month ago
  • 1.0.0-c8bc385.0                                ...           a month ago
  • 1.0.0-4a8bcc8.0                                ...           a month ago
  • 1.0.0-9a0ccab.0                                ...           a month ago
  • 1.0.0-9ffcc82.0                                ...           a month ago
  • 1.0.0-c4c0f2d.0                                ...           a month ago
  • 1.0.0-dc57a20.0                                ...           a month ago
  • 1.0.0-c8911d9.0                                ...           a month ago
  • 1.0.0-f32f42e.0                                ...           a month ago
  • 1.0.0-4aaaab3.0                                ...           a month ago
  • 1.0.0-3cdec8f.0                                ...           a month ago
  • 1.0.0-1c7f442.0                                ...           a month ago
  • 1.0.0-cafd3f6.0                                ...           a month ago
  • 1.0.0-61314e7.0                                ...           a month ago
  • 1.0.0-7ed0e8d.0                                ...           a month ago
  • 1.0.0-ddd63a6.0                                ...           a month ago
  • 1.0.0-87994fd.0                                ...           a month ago
  • 1.0.0-a2e3072.0                                ...           a month ago
  • 1.0.0-d8bdefa.0                                ...           a month ago
  • 1.0.0-26a67f8.0                                ...           a month ago
  • 1.0.0-3bcc59e.0                                ...           a month ago
  • 1.0.0-6e3ab77.0                                ...           a month ago
  • 1.0.0-01ddaef.0                                ...           a month ago
  • 1.0.0-d691e17.0                                ...           a month ago
  • 1.0.0-f0c0407.0                                ...           a month ago
  • 1.0.0-bed99ab.0                                ...           a month ago
  • 1.0.0-f04ffe4.0                                ...           a month ago
  • 1.0.0-4cb1d6b.0                                ...           a month ago
  • 1.0.0-7e1cc2e.0                                ...           a month ago
  • 1.0.0-2107d33.0                                ...           a month ago
  • 1.0.0-a434dfe.0                                ...           a month ago
  • 1.0.0-005251b.0                                ...           a month ago
  • 1.0.0-f4d2da9.0                                ...           a month ago
  • 1.0.0-f3f762e.0                                ...           a month ago
  • 1.0.0-1a14cb0.0                                ...           a month ago
  • 1.0.0-8eff759.0                                ...           a month ago
  • 1.0.0-04d5081.0                                ...           a month ago
  • 1.0.0-0f9c3d5.0                                ...           a month ago
  • 1.0.0-190acee.0                                ...           a month ago
  • 1.0.0-917e3c2.0                                ...           a month ago
  • 1.0.0-3891703.0                                ...           a month ago
  • 1.0.0-39771b7.0                                ...           a month ago
  • 1.0.0-627bdc8.0                                ...           a month ago
  • 1.0.0-fd0e74b.0                                ...           a month ago
  • 1.0.0-7897cea.0                                ...           a month ago
  • 1.0.0-dc1944d.0                                ...           a month ago
  • 1.0.0-80c2c79.0                                ...           a month ago
  • 1.0.0-264a106.0                                ...           a month ago
  • 1.0.0-39279e1.0                                ...           a month ago
  • 1.0.0-56e5d30.0                                ...           a month ago
  • 1.0.0-c9d7905.0                                ...           a month ago
  • 1.0.0-81e0942.0                                ...           a month ago
  • 1.0.0-a5d5ca1.0                                ...           a month ago
  • 1.0.0-91af1b1.0                                ...           a month ago
  • 1.0.0-4d72968.0                                ...           a month ago
  • 1.0.0-dd96185.0                                ...           a month ago
  • 1.0.0-9fe41f1.0                                ...           a month ago
  • 1.0.0-298ef28.0                                ...           a month ago
  • 1.0.0-7a19668.0                                ...           a month ago
  • 1.0.0-962f50f.0                                ...           a month ago
  • 1.0.0-5b44362.0                                ...           a month ago
  • 1.0.0-74fac6d.0                                ...           a month ago
  • 1.0.0-50fbea6.0                                ...           a month ago
  • 1.0.0-e5320d4.0                                ...           a month ago
  • 1.0.0-9314d62.0                                ...           a month ago
  • 1.0.0-c98bac2.0                                ...           a month ago
  • 1.0.0-ecc3c8e.0                                ...           a month ago
  • 1.0.0-ade6085.0                                ...           a month ago
  • 1.0.0-c18f4c3.0                                ...           a month ago
  • 1.0.0-59c381f.0                                ...           a month ago
  • 1.0.0-9af282c.0                                ...           a month ago
  • 1.0.0-61646ca.0                                ...           a month ago
  • 1.0.0-666274b.0                                ...           a month ago
  • 1.0.0-272d825.0                                ...           a month ago
  • 1.0.0-fc26c35.0                                ...           a month ago
  • 1.0.0-05334eb.0                                ...           a month ago
  • 1.0.0-e466e20.0                                ...           a month ago
  • 1.0.0-a9a92cc.0                                ...           2 months ago
  • 1.0.0-4f6fc4c.0                                ...           2 months ago
  • 1.0.0-9f9237f.0                                ...           2 months ago
  • 1.0.0-498d166.0                                ...           2 months ago
  • 1.0.0-17efef4.0                                ...           2 months ago
  • 1.0.0-69e4c26.0                                ...           2 months ago
  • 1.0.0-eef9c0f.0                                ...           2 months ago
  • 1.0.0-92e2548.0                                ...           2 months ago
  • 1.0.0-03a4bef.0                                ...           2 months ago
  • 1.0.0-788f331.0                                ...           2 months ago
  • 1.0.0-fc185d0.0                                ...           2 months ago
  • 1.0.0-207423.0                                ...           2 months ago
  • 1.0.0-beta.1                                ...           2 months ago
  • 1.0.0-983ce2d.0                                ...           2 months ago
  • 1.0.0-58bd91b.0                                ...           2 months ago
  • 1.0.0-9642d32.0                                ...           2 months ago
  • 1.0.0-585b4c7.0                                ...           2 months ago
  • 1.0.0-a6759ac.0                                ...           2 months ago
  • 1.0.0-6e05261.0                                ...           2 months ago
  • 1.0.0-639218b.0                                ...           2 months ago
  • 1.0.0-55d8c68.0                                ...           2 months ago
  • 1.0.0-b6a8867.0                                ...           2 months ago
  • 1.0.0-411a7a2.0                                ...           2 months ago
  • 1.0.0-f14bbe0.0                                ...           2 months ago
  • 1.0.0-2169f26.0                                ...           2 months ago
  • 1.0.0-7029d96.0                                ...           2 months ago
  • 1.0.0-c72aaa1.0                                ...           2 months ago
  • 1.0.0-1fe516b.0                                ...           2 months ago
  • 1.0.0-ed1ca2f.0                                ...           2 months ago
  • 1.0.0-91a1b8e.0                                ...           2 months ago
  • 1.0.0-336dd92.0                                ...           2 months ago
  • 1.0.0-b37b156.0                                ...           2 months ago
  • 1.0.0-20ef03b.0                                ...           2 months ago
  • 1.0.0-cb4dc54.0                                ...           2 months ago
  • 1.0.0-202d862.0                                ...           2 months ago
  • 1.0.0-45547da.0                                ...           2 months ago
  • 1.0.0-5cbeb18.0                                ...           2 months ago
  • 1.0.0-ec9ae36.0                                ...           2 months ago
  • 1.0.0-c514fdb.0                                ...           2 months ago
  • 1.0.0-979d0c0.0                                ...           2 months ago
  • 1.0.0-6e9b518.0                                ...           2 months ago
  • 1.0.0-f21de21.0                                ...           2 months ago
  • 1.0.0-5c3cd3f.0                                ...           2 months ago
  • 1.0.0-296785f.0                                ...           2 months ago
  • 1.0.0-beta.0                                ...           2 months ago
  • 0.7.2-4e90e01.0                                ...           2 months ago
  • 0.7.2-230f671.0                                ...           2 months ago
  • 0.7.2-74abe92.0                                ...           2 months ago
  • 0.7.2-9b7e9cc.0                                ...           2 months ago
  • 0.7.2-0c828d9.0                                ...           2 months ago
  • 0.7.2-89a04ec.0                                ...           2 months ago
  • 0.7.2-5ea8587.0                                ...           2 months ago
  • 0.7.2-c2d1532.0                                ...           2 months ago
  • 0.7.2-41d991b.0                                ...           2 months ago
  • 0.7.2-8fb11ff.0                                ...           2 months ago
  • 0.7.2-c57203f.0                                ...           2 months ago
  • 0.7.1                                ...           a year ago
  • 0.7.0                                ...           a year ago
  • 0.6.0                                ...           2 years ago
  • 0.5.3                                ...           2 years ago
  • 0.5.2                                ...           2 years ago
  • 0.5.1                                ...           2 years ago
  • 0.5.0                                ...           2 years ago
  • 0.4.5                                ...           2 years ago
  • 0.4.4                                ...           2 years ago
  • 0.4.3                                ...           2 years ago
  • 0.4.2                                ...           2 years ago
  • 0.4.1                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.1                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.2.1                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.9                                ...           2 years ago
  • 0.1.8                                ...           2 years ago
  • 0.1.7                                ...           2 years ago
  • 0.1.6                                ...           2 years ago
  • 0.1.5                                ...           2 years ago
  • 0.1.4                                ...           2 years ago
  • 0.1.3                                ...           2 years ago
  • 0.1.2                                ...           2 years ago
  • 0.1.1                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Downloads
Today 10
This Week 837
This Month 9,998
Last Day 292
Last Week 2,116
Last Month 46,099
Dev Dependencies (0)
None
Dependents (149)

Copyright 2014 - 2016 © taobao.org |