This is the sample project that belongs to the Ember & Apollo Tutorial on How to GraphQL.
This project relies on two dependencies: Node and ember-cli
.
Verify these dependencies are installed and configured.
git clone https://github.com/howtographql/ember-apollo/
cd ember-apollo
2. Create GraphQL API with graphcool
# Install Graphcool CLI
yarn global add graphcool
# Create a new project based on the Hackernews schema
graphcool init --schema https://graphqlbin.com/hn.graphql --name Hackernews
This creates a GraphQL API for the following schema:
type Link implements Node {
description: String!
postedBy: User @relation(name: "UsersLinks")
url: String!
votes: [Vote!] @relation(name: "VotesOnLink")
}
type User implements Node {
links: [Link!] @relation(name: "UsersLinks")
name: String!
votes: [Vote!] @relation(name: "UsersVotes")
}
type Vote {
link: Link @relation(name: "VotesOnLink")
user: User @relation(name: "UsersVotes")
}
Copy the simple API endpoint URL (which you find by executing graphcool endpoints
) and replace __SIMPLE_API_URL__
in config/environment.js
.
Open your project in the Graphcool console (you can use the graphcool console
command in the terminal or simply navigate to it in the browser).
Then click the following items:
- Select Integrations in the left side-menu
- Select Email-Password Auth
- Select Enable
yarn install
yarn start