howtographql / ember-apollo

Sample project for the Ember & Apollo tutorial on How To GraphQL

Home Page:http://howtographql.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ember & Apollo Tutorial

This is the sample project that belongs to the Ember & Apollo Tutorial on How to GraphQL.

Running the app

0. Verify dependencies

This project relies on two dependencies: Node and ember-cli.

Verify these dependencies are installed and configured.

1. Clone repository

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")
}

3. Connect the app with your GraphQL API

Copy the simple API endpoint URL (which you find by executing graphcool endpoints) and replace __SIMPLE_API_URL__ in config/environment.js.

4. Enable email-password Authentication Provider

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

5. Install dependencies & run locally

yarn install
yarn start

About

Sample project for the Ember & Apollo tutorial on How To GraphQL

http://howtographql.com

License:MIT License


Languages

Language:JavaScript 70.0%Language:HTML 26.8%Language:CSS 3.2%