Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
longshuicy authored Apr 28, 2017
1 parent 9769322 commit 36bd8ff
Show file tree
Hide file tree
Showing 28 changed files with 316 additions and 319 deletions.
40 changes: 20 additions & 20 deletions data/schema/facebook-type/fbAlbumType.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ var {
var getField = require('../../../API/fbAPI').getField;
var getEdge = require('../../../API/fbAPI').getEdge;

const albumType = module.exports = new GraphQLObjectType({
name: 'album',
const fbAlbumType = module.exports = new GraphQLObjectType({
name: 'fbAlbum',
description: 'Return a facebook album.',
fields: () => ({
/*-------------------------- fields -----------------------------------*/
Expand All @@ -31,35 +31,35 @@ const albumType = module.exports = new GraphQLObjectType({
resolve: ({id}) => getField({id},'type')},
updated_time: { type: GraphQLString,
resolve: ({id}) => getField({id},'updated_time')},
from: { type: profileType,
from: { type: fbProfileType,
resolve: ({id}) => getField({id},'from')},
place: { type: pageType,
place: { type: fbPageType,
resolve: ({id}) => getField({id},'place')},
cover_photo: { type: photoType,
cover_photo: { type: fbPhotoType,
resolve: ({id}) => getField({id},'cover_photo')},
event: { type: eventType,
event: { type: fbEventType,
resolve: ({id}) => getField({id},'event')},
/*-------------------------- edges ---------------------------------- */
photos: { type: new GraphQLList(photoType),
photos: { type: new GraphQLList(fbPhotoType),
resolve: ({id}) => getEdge({id},'photos')},
sharedposts: { type: new GraphQLList(postType),
sharedposts: { type: new GraphQLList(fbPostType),
resolve: ({id}) => getEdge({id},'sharedposts')},
likes: { type: new GraphQLList(likeType),
likes: { type: new GraphQLList(fbLikeType),
resolve: ({id}) => getEdge({id},'likes')},
reactions: { type: new GraphQLList(reactionType),
reactions: { type: new GraphQLList(fbReactionType),
resolve: ({id}) => getEdge({id},'reactions')},
comments: { type: new GraphQLList(commentType),
comments: { type: new GraphQLList(fbCommentType),
resolve: ({id}) => getEdge({id},'comments')}
})
});

const profileType = require('./fbProfileType');
const userType = require('./fbUserType');
const pageType = require('./fbPageType');
const photoType = require('./fbPhotoType');
const eventType = require('./fbEventType');
const commentType = require('./fbCommentType');
const likeType = require('./fbLikeType');
const reactionType = require('./fbReactionType');
const postType = require('./fbPostType');
const fbProfileType = require('./fbProfileType');
const fbUserType = require('./fbUserType');
const fbPageType = require('./fbPageType');
const fbPhotoType = require('./fbPhotoType');
const fbEventType = require('./fbEventType');
const fbCommentType = require('./fbCommentType');
const fbLikeType = require('./fbLikeType');
const fbReactionType = require('./fbReactionType');
const fbPostType = require('./fbPostType');

8 changes: 4 additions & 4 deletions data/schema/facebook-type/fbAttachmentType.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ var {
var getField = require('../../../API/fbAPI').getField;
var getEdge = require('../../../API/fbAPI').getEdge;

const attachmentType = module.exports = new GraphQLObjectType({
name: 'attachment',
const fbAttachmentType = module.exports = new GraphQLObjectType({
name: 'fbAttachment',
description: 'Media content associated with a story or comment. Story attachments are accessed from the following endpoints:',
fields: () => ({
description: {type: GraphQLString},
description_tags: {type: new GraphQLList(userType)},
description_tags: {type: new GraphQLList(fbUserType)},
media: {type: GraphQLString},
title: {type: GraphQLString},
type: {type: GraphQLString},
url: {type: GraphQLString}
})
});

const userType = require('./fbUserType');
const fbUserType = require('./fbUserType');
22 changes: 11 additions & 11 deletions data/schema/facebook-type/fbCommentType.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,38 @@ var {
var getField = require('../../../API/fbAPI').getField;
var getEdge = require('../../../API/fbAPI').getEdge;

const commentType = module.exports = new GraphQLObjectType({
name:'comment',
const fbCommentType = module.exports = new GraphQLObjectType({
name:'fbComment',
description:`A comment can be made on various types of content
on Facebook. Most Graph API nodes have a /comments edge that
lists all the comments on that object. The /{comment-id} node
returns a single comment.`,
fields: ()=>({
/*-----------------------------------fields------------------------------*/
id: { type: GraphQLString},
attachment: { type: attachmentType,
attachment: { type: fbAttachmentType,
resolve: ({id}) => getField({id},'attachment')},
comment_count: { type: GraphQLInt,
resolve: ({id}) => getField({id},'comment_count')},
created_time: { type: GraphQLString,
resolve: ({id}) => getField({id},'created_time')},
from: { type: profileType,
from: { type: fbProfileType,
resolve: ({id}) => getField({id},'from')},
like_count: { type: GraphQLInt,
resolve: ({id}) => getField({id},'like_count')},
message: { type: GraphQLString,
resolve: ({id}) => getField({id},'message')},
parent: { type: commentType,
parent: { type: fbCommentType,
resolve: ({id}) => getField({id},'parent')},
/*----------------------------------edges-------------------------------*/
likes: { type: new GraphQLList(likeType),
likes: { type: new GraphQLList(fbLikeType),
resolve: ({id}) => getEdge({id},'likes')},
comments: { type: new GraphQLList(commentType),
comments: { type: new GraphQLList(fbCommentType),
resolve: ({id}) => getEdge({id},'comments')}
})
});

const profileType = require('./fbProfileType');
const entityAtTextRangeType = require('./fbEntityAtTextRangeType');
const likeType = require('./fbLikeType');
const attachmentType = require('./fbAttachmentType');
const fbProfileType = require('./fbProfileType');
const fbEntityAtTextRangeType = require('./fbEntityAtTextRangeType');
const fbLikeType = require('./fbLikeType');
const fbAttachmentType = require('./fbAttachmentType');
4 changes: 2 additions & 2 deletions data/schema/facebook-type/fbCoverPhotoType.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ var {
GraphQLInt
} = require('graphql');

const coverPhotoType = module.exports = new GraphQLObjectType({
name: 'coverPhoto',
const fbCoverPhotoType = module.exports = new GraphQLObjectType({
name: 'fbCoverPhoto',
description: 'Return a facebook user\'s cover photo.',
fields: () => ({
id: { type: GraphQLString },
Expand Down
4 changes: 2 additions & 2 deletions data/schema/facebook-type/fbEntityAtTextRangeType.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ var {
GraphQLFloat
} = require('graphql');

const entityAtTextRangeType = module.exports = new GraphQLObjectType({
name:'entityAtTextRange',
const fbEntityAtTextRangeType = module.exports = new GraphQLObjectType({
name:'fbEntityAtTextRange',
description:`An array containing an array of objects mentioned in the
name field which contain the id, name, and type of each object as well
as the offset and length which can be used to match it up with its
Expand Down
50 changes: 25 additions & 25 deletions data/schema/facebook-type/fbEventType.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ var {
var getField = require('../../../API/fbAPI').getField;
var getEdge = require('../../../API/fbAPI').getEdge;

const eventType = module.exports = new GraphQLObjectType({
name: 'event',
const fbEventType = module.exports = new GraphQLObjectType({
name: 'fbEvent',
description: 'Return a facebook event.',
fields: ()=>({
/*---------------------------fields----------------------*/
Expand Down Expand Up @@ -41,45 +41,45 @@ const eventType = module.exports = new GraphQLObjectType({
resolve: ({id}) => getField({id},'type')},
updated_time: { type: GraphQLString,
resolve: ({id}) => getField({id},'updated_time')},
cover: { type: coverPhotoType,
cover: { type: fbCoverPhotoType,
resolve: ({id}) => getField({id},'cover')},
place: { type: placeType,
place: { type: fbPlaceType,
resolve: ({id}) => getField({id},'place')},
parent_group: { type: groupType,
parent_group: { type: fbGroupType,
resolve: ({id}) => getField({id},'parent_group')},

/*-----------------------------edges-----------------------------*/
admins: { type: new GraphQLList(userType),
admins: { type: new GraphQLList(fbUserType),
resolve: ({id}) => getEdge({id},'admins')},
attending: { type: new GraphQLList(userType),
attending: { type: new GraphQLList(fbUserType),
resolve: ({id}) => getEdge({id},'attending')},
comments: { type: new GraphQLList(commentType),
comments: { type: new GraphQLList(fbCommentType),
resolve: ({id}) => getEdge({id},'comments')},
declined: { type: new GraphQLList(userType),
declined: { type: new GraphQLList(fbUserType),
resolve: ({id}) => getEdge({id},'declined')},
interested: { type: new GraphQLList(userType),
interested: { type: new GraphQLList(fbUserType),
resolve: ({id}) => getEdge({id},'interested')},
maybe: { type: new GraphQLList(userType),
maybe: { type: new GraphQLList(fbUserType),
resolve: ({id}) => getEdge({id},'maybe')},
noreply: { type: new GraphQLList(userType),
noreply: { type: new GraphQLList(fbUserType),
resolve: ({id}) => getEdge({id},'noreply')},
photos: { type: new GraphQLList(photoType),
photos: { type: new GraphQLList(fbPhotoType),
resolve: ({id}) => getEdge({id},'photos')},
picture: { type: profilePictureType,
picture: { type: fbProfilePictureType,
resolve: ({id}) => getEdge({id},'picture')},
videos: { type: new GraphQLList(videoType),
videos: { type: new GraphQLList(fbVideoType),
resolve: ({id}) => getEdge({id},'videos')},
feed: { type: new GraphQLList(postType),
feed: { type: new GraphQLList(fbPostType),
resolve: ({id}) => getEdge({id},'feed')}
})
});

const coverPhotoType = require('./fbCoverPhotoType');
const placeType = require('./fbPlaceType');
const groupType = require('./fbGroupType');
const userType = require('./fbUserType');
const photoType = require('./fbPhotoType');
const commentType = require('./fbCommentType');
const videoType = require('./fbVideoType');
const postType = require('./fbPostType');
const profilePictureType = require('./fbProfilePicType');
const fbCoverPhotoType = require('./fbCoverPhotoType');
const fbPlaceType = require('./fbPlaceType');
const fbGroupType = require('./fbGroupType');
const fbUserType = require('./fbUserType');
const fbPhotoType = require('./fbPhotoType');
const fbCommentType = require('./fbCommentType');
const fbVideoType = require('./fbVideoType');
const fbPostType = require('./fbPostType');
const fbProfilePictureType = require('./fbProfilePicType');
12 changes: 6 additions & 6 deletions data/schema/facebook-type/fbExpType.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ var {
GraphQLString
} = require('graphql');

const experienceType = module.exports = new GraphQLObjectType({
name:'experience',
const fbExperienceType = module.exports = new GraphQLObjectType({
name:'fbExperience',
description: 'experience',
fields: ()=>({
id: { type: GraphQLString },
description: { type: GraphQLString },
from: { type: pageType },
from: { type: fbPageType },
name: { type: GraphQLString },
with: { type: new GraphQLList(userType) }
with: { type: new GraphQLList(fbUserType) }
})
});

const userType = require('./fbUserType');
const pageType = require('./fbPageType');
const fbUserType = require('./fbUserType');
const fbPageType = require('./fbPageType');
//const profileType = require('./fbProfileType');
42 changes: 21 additions & 21 deletions data/schema/facebook-type/fbGroupType.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ var {
var getField = require('../../../API/fbAPI').getField;
var getEdge = require('../../../API/fbAPI').getEdge;

const groupType = module.exports = new GraphQLObjectType({
name: 'group',
const fbGroupType = module.exports = new GraphQLObjectType({
name: 'fbGroup',
description:'Represents a Facebook group.',
fields: ()=>({
/*-------------------------------------fields------------------------------------*/
id: { type: GraphQLString },
cover: { type: coverPhotoType,
cover: { type: fbCoverPhotoType,
resolve: ({id}) => getField({id},'cover')},
description: { type: GraphQLString,
resolve: ({id}) => getField({id},'description')},
Expand All @@ -25,36 +25,36 @@ const groupType = module.exports = new GraphQLObjectType({
member_request_count: { type: GraphQLInt,
resolve: ({id}) => getField({id},'member_request_count')},
name: { type: GraphQLString},
owner: { type: profileType},
parent: { type: profileType},
owner: { type: fbProfileType},
parent: { type: fbProfileType},
privacy: { type: GraphQLString,
resolve: ({id}) => getField({id},'privacy')},
updated_time: { type: GraphQLString,
resolve: ({id}) => getField({id},'updated_time')},
/*-------------------------------------edges------------------------------------*/
admins: { type: new GraphQLList(userType),
admins: { type: new GraphQLList(fbUserType),
resolve: ({id}) => getEdge({id},'admins')},
albums: { type: new GraphQLList(albumType),
albums: { type: new GraphQLList(fbAlbumType),
resolve: ({id}) => getEdge({id},'albums')},
events: { type: new GraphQLList(eventType),
events: { type: new GraphQLList(fbEventType),
resolve: ({id}) => getEdge({id},'events')},
members: { type: new GraphQLList(userType),
members: { type: new GraphQLList(fbUserType),
resolve: ({id}) => getEdge({id},'members')},
photos: { type: new GraphQLList(photoType),
photos: { type: new GraphQLList(fbPhotoType),
resolve: ({id}) => getEdge({id},'photos')},
feed: { type: new GraphQLList(postType),
feed: { type: new GraphQLList(fbPostType),
resolve: ({id}) => getEdge({id},'feed')},
videos: { type: new GraphQLList(videoType),
videos: { type: new GraphQLList(fbVideoType),
resolve: ({id}) => getEdge({id},'videos')}
})
});

const coverPhotoType = require('./fbCoverPhotoType');
const userType = require('./fbUserType');
const pageType = require('./fbPageType');
const photoType = require('./fbPhotoType');
const albumType = require('./fbAlbumType');
const eventType = require('./fbEventType');
const postType = require('./fbPostType');
const videoType = require('./fbVideoType');
const profileType = require('./fbProfileType');
const fbCoverPhotoType = require('./fbCoverPhotoType');
const fbUserType = require('./fbUserType');
const fbPageType = require('./fbPageType');
const fbPhotoType = require('./fbPhotoType');
const fbAlbumType = require('./fbAlbumType');
const fbEventType = require('./fbEventType');
const fbPostType = require('./fbPostType');
const fbVideoType = require('./fbVideoType');
const fbProfileType = require('./fbProfileType');
9 changes: 3 additions & 6 deletions data/schema/facebook-type/fbLikeType.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ var {
GraphQLFloat
} = require('graphql');

const likeType = module.exports = new GraphQLObjectType({
name:'like',
const fbLikeType = module.exports = new GraphQLObjectType({
name:'fbLike',
description:`this reference describes the /likes edge that is common
to multiple Graph API nodes. The structure and operations are the
same for each node.`,
Expand All @@ -23,7 +23,4 @@ const likeType = module.exports = new GraphQLObjectType({
This is only returned when the flag summary=true is set.int32*/

})
});

const userType = require('./fbUserType');
const pageType = require('./fbPageType');
});
4 changes: 2 additions & 2 deletions data/schema/facebook-type/fbLocationType.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ var {
GraphQLFloat
} = require('graphql');

const locationType = module.exports = new GraphQLObjectType({
name:'location',
const fbLocationType = module.exports = new GraphQLObjectType({
name:'fbLocation',
description:'Location of Place',
fields: () =>({
city: { type: GraphQLString },
Expand Down
Loading

0 comments on commit 36bd8ff

Please sign in to comment.