This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const express = require('express'); | |
const app = express(); | |
const PORT = 3001; | |
app.listen(PORT, () => { | |
console.log('Server running on port', PORT); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const graphql = require('graphql'); | |
const pokemonType = new graphql.GraphQLObjectType({ | |
name : 'PokemonType', | |
fields : { | |
id : { | |
type : graphql.GraphQLString | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const graphql = require('graphql'); | |
const pokemonType = new graphql.GraphQLObjectType({ | |
name : 'PokemonType', | |
fields : { | |
id : { | |
type : graphql.GraphQLString | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const express = require('express'); | |
const graphql = require('graphql').graphql; | |
const rootSchema = require('./schema/rootSchema'); | |
const app = express(); | |
const PORT = 3001; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const graphql = require('graphql'); | |
const pokemonType = require('./pokemon/pokemon'); | |
const schema = new graphql.GraphQLSchema({ | |
query : new graphql.GraphQLObjectType({ | |
name : 'Query', | |
fields : { | |
pokemon : pokemonType |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const express = require('express'); | |
const graphql = require('graphql').graphql; | |
const graphqlHTTP = require('express-graphql'); | |
const rootSchema = require('./schema/rootSchema'); | |
const app = express(); | |
const PORT = 3001; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const request = require('request-promise'); | |
const path = require('path'); | |
const Promise = require('bluebird'); | |
const BASE_PATH = 'http://pokeapi.co/api/v2/'; | |
function getPokemon(id) { | |
return request({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const graphql = require('graphql'); | |
const client = require('./pokemon.client'); | |
const pokemonType = new graphql.GraphQLObjectType({ | |
name : 'PokemonType', | |
fields : { | |
id : { | |
type : graphql.GraphQLString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const request = require('request-promise'); | |
const path = require('path'); | |
const Promise = require('bluebird'); | |
const BASE_PATH = 'http://pokeapi.co/api/v2/'; | |
function getPokemon(id) { | |
return request({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const graphql = require('graphql'); | |
const chai = require('chai'); | |
const pokemon = require('./pokemon'); | |
const pokemonType = pokemon.type; | |
const expect = chai.expect; |
OlderNewer