Skip to content

Commit

Permalink
add api prefix to the types
Browse files Browse the repository at this point in the history
  • Loading branch information
longshuicy authored Apr 28, 2017
1 parent 6da7711 commit af8345e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions data/schema/flickr-type/flickrPandaType.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const flickrPandaType = module.exports = new GraphQLObjectType({
_content: {type: GraphQLString},
photos: {type: new GraphQLList(flickrPhotoType),
args:{
page: {type:GraphQLInt, defaultvalue:1},
per_page: {type:GraphQLInt, defaultvalue:10}
page: {type:GraphQLInt, defaultValue:1},
per_page: {type:GraphQLInt, defaultValue:10}
},
resolve:({_content},args) => getPandaPhotos(_content,args)}
})
Expand Down
30 changes: 15 additions & 15 deletions data/schema/flickr-type/flickrPersonType.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ const flickrPersonType = module.exports = new GraphQLObjectType({
popular: {type:new GraphQLList(flickrPhotoType),
description:'Returns a list of popular photos of a given user',
args: {
page: {type:GraphQLInt, defaultvalue:1},
per_page: {type:GraphQLInt, defaultvalue:10},
sort: {type:GraphQLString, defaultvalue:"interesting"}},
page: {type:GraphQLInt, defaultValue:1},
per_page: {type:GraphQLInt, defaultValue:10},
sort: {type:GraphQLString, defaultValue:"interesting"}},
resolve:({nsid},args) => flickrAPI(endpoint="photos.getPopular",addon={"user_id":nsid},args=args,resolveName='popular')},

photoset: {type:new GraphQLList(flickrPhotosetType),
description:'Returns the photosets belonging to the specified user.',
args: {
page: {type:GraphQLInt, defaultvalue:1},
per_page: {type:GraphQLInt, defaultvalue:10}},
page: {type:GraphQLInt, defaultValue:1},
per_page: {type:GraphQLInt, defaultValue:10}},
resolve: ({nsid},args) => flickrAPI(endpoint="photosets.getList",addon={"user_id":nsid},args=args,resolveName='photoset')},

profile: {type: flickrProfileType,
Expand All @@ -46,15 +46,15 @@ const flickrPersonType = module.exports = new GraphQLObjectType({
photos: {type:new GraphQLList(flickrPhotoType),
description:'Get a list of public photos for the given user.',
args: {
page: {type:GraphQLInt, defaultvalue:1},
per_page: {type:GraphQLInt, defaultvalue:10}},
page: {type:GraphQLInt, defaultValue:1},
per_page: {type:GraphQLInt, defaultValue:10}},
resolve: ({nsid},args) => flickrAPI(endpoint="people.getPublicPhotos",addon={"user_id":nsid},args=args,resolveName='photo')},

photosOf: {type:new GraphQLList(flickrPhotoType),
description:'Returns a list of photos containing a particular Flickr member.',
args: {
page: {type:GraphQLInt, defaultvalue:1},
per_page: {type:GraphQLInt, defaultvalue:10}},
page: {type:GraphQLInt, defaultValue:1},
per_page: {type:GraphQLInt, defaultValue:10}},
resolve: ({nsid},args) => flickrAPI(endpoint="people.getPhotosOf",addon={"user_id":nsid},args=args,resolveName='photoOf')},

collectionTree: {type: new GraphQLList(flickrSetType),
Expand All @@ -63,21 +63,21 @@ const flickrPersonType = module.exports = new GraphQLObjectType({

contacts: {type: new GraphQLList(flickrPersonType),
args: {
page: {type:GraphQLInt, defaultvalue:1},
per_page: {type:GraphQLInt, defaultvalue:10}},
page: {type:GraphQLInt, defaultValue:1},
per_page: {type:GraphQLInt, defaultValue:10}},
resolve: ({nsid},args) => flickrAPI(endpoint="contacts.getPublicList",addon={"user_id":nsid},args=args,resolveName='contact')},

favoritePhotos: {type: new GraphQLList(flickrPhotoType),
args: {
page: {type:GraphQLInt, defaultvalue:1},
per_page: {type:GraphQLInt, defaultvalue:10}},
page: {type:GraphQLInt, defaultValue:1},
per_page: {type:GraphQLInt, defaultValue:10}},
resolve: ({nsid},args) => flickrAPI(endpoint="favorites.getPublicList",addon={"user_id":nsid},args=args,resolveName='favoritePhotos')},

gallaries: {type: new GraphQLList(flickrGalleryType),
description:'Return the list of galleries created by a user. Sorted from newest to oldest.',
args: {
page: {type:GraphQLInt, defaultvalue:1},
per_page: {type:GraphQLInt, defaultvalue:10}},
page: {type:GraphQLInt, defaultValue:1},
per_page: {type:GraphQLInt, defaultValue:10}},
resolve: ({nsid},args) => flickrAPI(endpoint="galleries.getList",addon={"user_id":nsid},args=args,resolveName='gallery')},

tags: {type: new GraphQLList(flickrTagType),
Expand Down
4 changes: 2 additions & 2 deletions data/schema/flickr-type/flickrPhotoType.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ const flickrPhotoType = module.exports = new GraphQLObjectType({
galleriesOf: {type: new GraphQLList(flickrGalleryType),
description:'Return the list of galleries to which a photo has been added. Galleries are returned sorted by date which the photo was added to the gallery.',
args: {
page: {type:GraphQLInt, defaultvalue:1},
per_page: {type:GraphQLInt, defaultvalue:10}},
page: {type:GraphQLInt, defaultValue:1},
per_page: {type:GraphQLInt, defaultValue:10}},
resolve: ({id},args) => flickrAPI(endpoint = "galleries.getListForPhoto", addon = {"photo_id":id}, args = args,resolveName='galleriesOf')},
})
});
Expand Down

0 comments on commit af8345e

Please sign in to comment.