0.0.1 • Published 8 years ago
ember-cli-graphql-file v0.0.1
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});
}
});
0.0.1
8 years ago