All Projects → Swydo → meteor-graphql

Swydo / meteor-graphql

Licence: MIT license
Compiler plugin that supports GraphQL files in Meteor

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to meteor-graphql

Vuepack
Publish .vue files in NPM packages
Stars: ✭ 242 (+332.14%)
Mutual labels:  package, build-tool
importar
R package to import/load packages or functions the 'Python' way
Stars: ✭ 17 (-69.64%)
Mutual labels:  package, import
lint-deps
Lint for unused or missing dependencies in your node.js projects. Customize with plugins or configuration.
Stars: ✭ 48 (-14.29%)
Mutual labels:  package, import
ali-opensearch-sdk
阿里云开放搜索 laravel SDK
Stars: ✭ 36 (-35.71%)
Mutual labels:  package
Parrot
Web router specially designed for building SPAs using Meteor
Stars: ✭ 75 (+33.93%)
Mutual labels:  meteor
telegram
📚 Golang bindings for Telegram API
Stars: ✭ 15 (-73.21%)
Mutual labels:  package
flow-router
🚦 Carefully extended flow-router for Meteor
Stars: ✭ 191 (+241.07%)
Mutual labels:  meteor
get-bin-path
Get the current package's binary path
Stars: ✭ 25 (-55.36%)
Mutual labels:  package
babel-loader-lerna-cra
Transpile Create-React-App imports in Lerna projects.
Stars: ✭ 30 (-46.43%)
Mutual labels:  import
SwiftPackage
🏆 Template to make a Swift package
Stars: ✭ 37 (-33.93%)
Mutual labels:  package
ngp
New Go Package
Stars: ✭ 22 (-60.71%)
Mutual labels:  package
denormalize
Simple denormalization for Meteor
Stars: ✭ 21 (-62.5%)
Mutual labels:  meteor
Dynamic-Parkour-System
Dynamic Parkour System is a FREE plugin for Unity that allows anyone to import any model and have an already working controller with parkour capabilities like in Assassin's Creed games.
Stars: ✭ 694 (+1139.29%)
Mutual labels:  package
Meteor-flow-router-title
Change document.title on the fly within flow-router
Stars: ✭ 23 (-58.93%)
Mutual labels:  meteor
build
Build system scripts based on GENie (https://github.com/bkaradzic/genie) project generator
Stars: ✭ 30 (-46.43%)
Mutual labels:  build-tool
janusgraph-util
util for janusgraph to import data and so on/Janusgraph 导数据等工具
Stars: ✭ 72 (+28.57%)
Mutual labels:  import
FinMesh
A python package that brings together financial and economic data.
Stars: ✭ 20 (-64.29%)
Mutual labels:  package
hou packager
A simple SideFX Houdini package manager
Stars: ✭ 28 (-50%)
Mutual labels:  package
repology-rules
Package normalization ruleset for Repology
Stars: ✭ 67 (+19.64%)
Mutual labels:  package
autosetup
A better, faster autoconf replacement
Stars: ✭ 60 (+7.14%)
Mutual labels:  build-tool

Meteor GraphQL

Compiler plugin that supports GraphQL files in Meteor

Build Status Greenkeeper badge

Installation

meteor add swydo:graphql

Usage

Queries

# query.grahql
query getPerson ($id: ID!) {
  person(id: $id) {
    name
    email
  }
}
import query from './query.graphql';

// See https://github.com/apollographql/apollo-client for setup
const client = new ApolloClient();

// The query is parsed and can be directly passed to the Apollo Client
client.query({ query }).then(console.log);

Multiple queries in one file

It's also possible to define multiple queries in one file:

# queries.grahql

query foo {
    baz
}

query bar {
    baz
}
import { foo, bar } from './queries.graphql';

const client = new ApolloClient();

client.query({ query: foo }).then(console.log);

Schemas

You can also import your main schema and pass it directly to makeExecutableSchema.

# schema.graphql

"""
This is a description of a Person
This will show up in GraphiQL
"""
type Person {
  id: ID!
  name: String
  email: String
}

type Query {
  person(id!): Person
}
import { makeExecutableSchema } from 'graphql-tools';

import typeDefs from './schema.graphql'; // No need to parse it!
import resolvers from './resolvers';

const schema = makeExecutableSchema({
  typeDefs,
  resolvers,
});

Importing .graphql files in other .graphql files

The cool thing is that you can use import comments, that will import all definitions from another file:

#import "./personSchema.graphql"

type Query {
  # It will recognize the Person type from the personSchema.graphql file
  person(id): Person
}

Extensions

We recommend to always use .graphql, but also .graphqls and .gql files are supported.

Benefits

There are some good reasons to use .graphql files instead of the inline syntax:

Sponsor

Swydo

Want to work with Meteor and GraphQL? Join the team!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].