https://github.com/mirego/ember-cli-graphql-file
An addon to precompile your `.graphql` files with `graphql-tag` and turn them into importable modules.
https://github.com/mirego/ember-cli-graphql-file
ember ember-addon ember-cli graphql
Last synced: about 1 year ago
JSON representation
An addon to precompile your `.graphql` files with `graphql-tag` and turn them into importable modules.
- Host: GitHub
- URL: https://github.com/mirego/ember-cli-graphql-file
- Owner: mirego
- License: bsd-3-clause
- Created: 2017-02-05T21:09:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-05-12T15:25:35.000Z (about 6 years ago)
- Last Synced: 2025-03-26T05:02:46.302Z (about 1 year ago)
- Topics: ember, ember-addon, ember-cli, graphql
- Language: JavaScript
- Size: 11.7 KB
- Stars: 5
- Watchers: 40
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ember-cli-graphql-file
An addon to precompile your `.graphql` files with [graphql-tag](https://github.com/apollographql/graphql-tag) and turn them into importable modules.
## Installation
```
$ ember install ember-cli-graphql-file
```
## Usage
__Put your GraphQL query in a file__
```graphql
# app/graphql/query.graphql
query {
hero {
name
friends {
name
}
}
}
```
__Import it from JS to execute it with Apollo__
```js
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](http://www.mirego.com) and may be freely distributed under the [New BSD license](http://opensource.org/licenses/BSD-3-Clause).
See the [`LICENSE.md`](https://github.com/mirego/ember-cli-graphql-file/blob/master/LICENSE.md) file.
## About Mirego
[Mirego](http://mirego.com) 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](http://life.mirego.com) who imagine and build beautiful Web and mobile applications. We come together to share ideas and [change the world](http://mirego.org).
We also [love open-source software](http://open.mirego.com) and we try to give back to the community as much as we can.