An addon to precompile your `.graphql` files with `graphql-tag` and turn them into importable modules.
JavaScript HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config
tests
.editorconfig
.ember-cli
.eslintignore
.eslintrc
.gitignore
.npmignore
.travis.yml
.watchmanconfig
LICENSE.md
README.md
ember-cli-build.js
index.js
package.json
testem.js

README.md

ember-cli-graphql-file

An addon to precompile your .graphql files with graphql-tag and turn them into importable modules.

Installation

$ ember install ember-cli-graphql-file

Usage

Put your GraphQL query in a file

# app/graphql/query.graphql

query {
  hero {
    name

    friends {
      name
    }
  }
}

Import it from JS to execute it with Apollo

import Ember from 'ember';
import query from 'my-app/graphql/query';

export Ember.Route.extend({
  apollo: Ember.inject.service(),

  model() {
    return this.get('apollo').query({query});
  }
});

License

ember-cli-graphql-file is © 2017 Mirego and may be freely distributed under the New BSD license. See the LICENSE.md file.

About Mirego

Mirego is a team of passionate people who believe that work is a place where you can innovate and have fun. We're a team of talented people who imagine and build beautiful Web and mobile applications. We come together to share ideas and change the world.

We also love open-source software and we try to give back to the community as much as we can.