This file contains hidden or 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
const User = new GraphQLObjectType({ | |
name: 'User', | |
description: 'Represents user', | |
fields: () => ({ | |
_id: { type: GraphQLString }, | |
firstName: { type: GraphQLString }, | |
lastName: { type: GraphQLString }, | |
role: { type: GraphQLString } | |
}) | |
}); |
This file contains hidden or 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
import { | |
GraphQLList, | |
GraphQLObjectType, | |
GraphQLSchema, | |
GraphQLString, | |
} from 'graphql'; |
This file contains hidden or 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
users: { | |
type: new GraphQLList(User), | |
description: 'Netguru members', | |
resolve: () => { | |
return USER.find({}, (err, res) => { | |
return res; | |
}); | |
} | |
} |
This file contains hidden or 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
/* eslint no-underscore-dangle: off*/ | |
/* eslint "arrow-body-style": off */ | |
import { | |
GraphQLList, | |
GraphQLObjectType, | |
GraphQLSchema, | |
GraphQLString, | |
} from 'graphql'; |
This file contains hidden or 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
import { | |
GraphQLList, | |
GraphQLObjectType, | |
GraphQLSchema, | |
GraphQLString, | |
GraphQLBoolean, | |
GraphQLInt | |
} from 'graphql'; |
This file contains hidden or 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
const Skill = new GraphQLObjectType({ | |
name: 'Skill', | |
description: 'Represents skill', | |
fields: () => ({ | |
_id: { type: GraphQLString }, | |
name: { type: GraphQLString } | |
}) | |
}); | |
const SkillLevel = new GraphQLObjectType({ |
This file contains hidden or 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
const User = new GraphQLObjectType({ | |
name: 'User', | |
description: 'Represents user', | |
fields: () => ({ | |
_id: { type: GraphQLString }, | |
firstName: { type: GraphQLString }, | |
lastName: { type: GraphQLString }, | |
role: { type: GraphQLString }, | |
skillLevels: { | |
type: new GraphQLList(SkillLevel), |
This file contains hidden or 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
const Skill = new GraphQLObjectType({ | |
name: 'Skill', | |
description: 'Represents skill', | |
fields: () => ({ | |
_id: { type: GraphQLString }, | |
name: { type: GraphQLString }, | |
skillLevels: { | |
type: new GraphQLList(SkillLevel), | |
description: 'Returns list of levels corrsponding to the skill. It is similar to list of grades for a certain subject in school', | |
resolve: (skill) => { |
This file contains hidden or 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
const SkillLevel = new GraphQLObjectType({ | |
name: 'SkillLevel', | |
description: 'Describes how well user knows certain skill.', | |
fields: () => ({ | |
_id: { type: GraphQLString }, | |
level: { | |
type: GraphQLInt, | |
description: 'Actual skill level, ranked from 1 to 3' | |
}, | |
favorite: { type: GraphQLBoolean }, |
This file contains hidden or 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
it('should return iMList once fetched', () => { | |
const action = { | |
type: FETCH_IM_LIST_SUCCESS, | |
payload: { | |
data: { | |
ok: true, | |
ims: [ | |
{ | |
id: "D4VAKS265", | |
created: 1491558944, |
OlderNewer