From 36bd8ff9fbe2827c604f3c8f8227048d5e025f02 Mon Sep 17 00:00:00 2001 From: longshuicy Date: Thu, 27 Apr 2017 20:22:51 -0500 Subject: [PATCH] Add files via upload --- data/schema/facebook-type/fbAlbumType.js | 40 +++---- data/schema/facebook-type/fbAttachmentType.js | 8 +- data/schema/facebook-type/fbCommentType.js | 22 ++-- data/schema/facebook-type/fbCoverPhotoType.js | 4 +- .../facebook-type/fbEntityAtTextRangeType.js | 4 +- data/schema/facebook-type/fbEventType.js | 50 ++++----- data/schema/facebook-type/fbExpType.js | 12 +- data/schema/facebook-type/fbGroupType.js | 42 +++---- data/schema/facebook-type/fbLikeType.js | 9 +- data/schema/facebook-type/fbLocationType.js | 4 +- data/schema/facebook-type/fbPageType.js | 76 ++++++------- data/schema/facebook-type/fbPhotoType.js | 60 +++++----- data/schema/facebook-type/fbPlaceTopicType.js | 4 +- data/schema/facebook-type/fbPlaceType.js | 8 +- data/schema/facebook-type/fbPostType.js | 36 +++--- data/schema/facebook-type/fbProfilePicType.js | 4 +- data/schema/facebook-type/fbProfileType.js | 10 +- data/schema/facebook-type/fbReactionType.js | 4 +- data/schema/facebook-type/fbThumbnailType.js | 4 +- data/schema/facebook-type/fbUserType.js | 104 +++++++++--------- data/schema/facebook-type/fbVideoType.js | 60 +++++----- data/schema/fbSchema.js | 24 ++-- data/schema/twitter-type/twtEntityType.js | 8 +- data/schema/twitter-type/twtGeoType.js | 6 +- data/schema/twitter-type/twtRetweetType.js | 8 +- data/schema/twitter-type/twtTweetType.js | 8 +- data/schema/twitter-type/twtUserType.js | 8 +- data/schema/twitterSchema.js | 8 +- 28 files changed, 316 insertions(+), 319 deletions(-) diff --git a/data/schema/facebook-type/fbAlbumType.js b/data/schema/facebook-type/fbAlbumType.js index e382fff..58ab907 100644 --- a/data/schema/facebook-type/fbAlbumType.js +++ b/data/schema/facebook-type/fbAlbumType.js @@ -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 -----------------------------------*/ @@ -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'); \ No newline at end of file diff --git a/data/schema/facebook-type/fbAttachmentType.js b/data/schema/facebook-type/fbAttachmentType.js index 477f73e..b44d9d7 100644 --- a/data/schema/facebook-type/fbAttachmentType.js +++ b/data/schema/facebook-type/fbAttachmentType.js @@ -9,12 +9,12 @@ 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}, @@ -22,4 +22,4 @@ const attachmentType = module.exports = new GraphQLObjectType({ }) }); -const userType = require('./fbUserType'); \ No newline at end of file +const fbUserType = require('./fbUserType'); \ No newline at end of file diff --git a/data/schema/facebook-type/fbCommentType.js b/data/schema/facebook-type/fbCommentType.js index 2957ffe..a252601 100644 --- a/data/schema/facebook-type/fbCommentType.js +++ b/data/schema/facebook-type/fbCommentType.js @@ -9,8 +9,8 @@ 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 @@ -18,29 +18,29 @@ const commentType = module.exports = new GraphQLObjectType({ 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'); diff --git a/data/schema/facebook-type/fbCoverPhotoType.js b/data/schema/facebook-type/fbCoverPhotoType.js index 314c4f2..5e89323 100644 --- a/data/schema/facebook-type/fbCoverPhotoType.js +++ b/data/schema/facebook-type/fbCoverPhotoType.js @@ -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 }, diff --git a/data/schema/facebook-type/fbEntityAtTextRangeType.js b/data/schema/facebook-type/fbEntityAtTextRangeType.js index 8d327d9..83857fc 100644 --- a/data/schema/facebook-type/fbEntityAtTextRangeType.js +++ b/data/schema/facebook-type/fbEntityAtTextRangeType.js @@ -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 diff --git a/data/schema/facebook-type/fbEventType.js b/data/schema/facebook-type/fbEventType.js index f06ec3c..6823ac7 100644 --- a/data/schema/facebook-type/fbEventType.js +++ b/data/schema/facebook-type/fbEventType.js @@ -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----------------------*/ @@ -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'); \ No newline at end of file +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'); \ No newline at end of file diff --git a/data/schema/facebook-type/fbExpType.js b/data/schema/facebook-type/fbExpType.js index a8720e8..98ea511 100644 --- a/data/schema/facebook-type/fbExpType.js +++ b/data/schema/facebook-type/fbExpType.js @@ -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'); \ No newline at end of file diff --git a/data/schema/facebook-type/fbGroupType.js b/data/schema/facebook-type/fbGroupType.js index 1badc85..79d5f37 100644 --- a/data/schema/facebook-type/fbGroupType.js +++ b/data/schema/facebook-type/fbGroupType.js @@ -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')}, @@ -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'); \ No newline at end of file +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'); \ No newline at end of file diff --git a/data/schema/facebook-type/fbLikeType.js b/data/schema/facebook-type/fbLikeType.js index 7309b1f..b57ba50 100644 --- a/data/schema/facebook-type/fbLikeType.js +++ b/data/schema/facebook-type/fbLikeType.js @@ -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.`, @@ -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'); \ No newline at end of file +}); \ No newline at end of file diff --git a/data/schema/facebook-type/fbLocationType.js b/data/schema/facebook-type/fbLocationType.js index d864a41..249c85f 100644 --- a/data/schema/facebook-type/fbLocationType.js +++ b/data/schema/facebook-type/fbLocationType.js @@ -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 }, diff --git a/data/schema/facebook-type/fbPageType.js b/data/schema/facebook-type/fbPageType.js index a23257b..123f770 100644 --- a/data/schema/facebook-type/fbPageType.js +++ b/data/schema/facebook-type/fbPageType.js @@ -8,8 +8,8 @@ var { var getField = require('../../../API/fbAPI').getField; var getEdge = require('../../../API/fbAPI').getEdge; -const pageType = module.exports = new GraphQLObjectType({ - name:'page', +const fbPageType = module.exports = new GraphQLObjectType({ + name:'fbPage', description: 'return a facebook page', fields: ()=>({ /*-----------------------------------fields--------------------------*/ @@ -73,7 +73,7 @@ const pageType = module.exports = new GraphQLObjectType({ resolve: ({id}) => getField({id},'influences')}, link: { type: GraphQLString, resolve: ({id}) => getField({id},'link')}, - location: { type: locationType, + location: { type: fbLocationType, resolve: ({id}) => getField({id},'location')}, members: { type: GraphQLString, resolve: ({id}) => getField({id},'members')}, @@ -134,45 +134,45 @@ const pageType = module.exports = new GraphQLObjectType({ written_by: { type: GraphQLString, resolve: ({id}) => getField({id},'written_by')}, - best_page: { type: pageType, + best_page: { type: fbPageType, resolve: ({id}) => getField({id},'best_page')}, - category_list: { type: new GraphQLList(pageCategoryType), + category_list: { type: new GraphQLList(fbPageCategoryType), resolve: ({id}) => getField({id},'category_list')}, - contact_address: { type: mailingAddressType, + contact_address: { type: fbMailingAddressType, resolve: ({id}) => getField({id},'contact_address')}, - cover: { type: coverPhotoType, + cover: { type: fbCoverPhotoType, resolve: ({id}) => getField({id},'cover')}, - parent_page: { type: pageType, + parent_page: { type: fbPageType, resolve: ({id}) => getField({id},'parent_page')}, - restaurant_services: { type: pageRestaurantServicesType, + restaurant_services: { type: fbPageRestaurantServicesType, resolve: ({id}) => getField({id},'restaurant_services')}, - restaurant_specialties: { type: pageRestaurantSpecialtiesType, + restaurant_specialties: { type: fbPageRestaurantSpecialtiesType, resolve: ({id}) => getField({id},'restaurant_specialties')}, /*---------------------------------edges----------------------*/ - albums: { type: new GraphQLList(albumType), + albums: { type: new GraphQLList(fbAlbumType), resolve: ({id}) => getEdge({id},'albums')}, - photos: { type: new GraphQLList(photoType), + photos: { type: new GraphQLList(fbPhotoType), resolve: ({id}) => getEdge({id},'photos')}, - events: { type: new GraphQLList(eventType), + events: { type: new GraphQLList(fbEventType), resolve: ({id}) => getEdge({id},'events')}, - locations: { type: new GraphQLList(locationType), + locations: { type: new GraphQLList(fbLocationType), resolve: ({id}) => getEdge({id},'locations')}, - likes: { type: new GraphQLList(likeType), + likes: { type: new GraphQLList(fbLikeType), resolve: ({id}) => getEdge({id},'likes')}, - 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')}, - picture: { type: profilePictureType, + picture: { type: fbProfilePictureType, resolve: ({id}) => getEdge({id},'picture')}, - tagged: { type: new GraphQLList(postType), + tagged: { type: new GraphQLList(fbPostType), resolve: ({id}) => getEdge({id},'tagged')} }) }); -const pageCategoryType = new GraphQLObjectType({ - name:'pageCategory', +const fbPageCategoryType = new GraphQLObjectType({ + name:'fbPageCategory', description:'The Page\'s sub-categories', fields: ()=>({ id: { type: GraphQLString }, @@ -180,13 +180,13 @@ const pageCategoryType = new GraphQLObjectType({ }) }) -const mailingAddressType = new GraphQLObjectType({ - name: 'mailingAddress', +const fbMailingAddressType = new GraphQLObjectType({ + name: 'fbMailingAddress', description: 'The mailing or contact address for this page. This field will be blank if the contact address is the same as the physical address', fields: ()=>({ id: { type: GraphQLString }, city: { type: GraphQLString }, - city_page: {type: pageType }, + city_page: {type: fbPageType }, country: { type: GraphQLString }, postal_code:{ type: GraphQLString }, region: { type: GraphQLString }, @@ -195,8 +195,8 @@ const mailingAddressType = new GraphQLObjectType({ }) }); -const pageRestaurantServicesType = new GraphQLObjectType({ - name: 'pageRestaurantServices', +const fbPageRestaurantServicesType = new GraphQLObjectType({ + name: 'fbPageRestaurantServices', description: '', fields: ()=>({ catering: { type:GraphQLInt }, @@ -212,8 +212,8 @@ const pageRestaurantServicesType = new GraphQLObjectType({ }) }); -const pageRestaurantSpecialtiesType = new GraphQLObjectType({ - name: 'pageRestaurantSpecialties', +const fbPageRestaurantSpecialtiesType = new GraphQLObjectType({ + name: 'fbPageRestaurantSpecialties', description: '', fields: ()=>({ breakfast: { type:GraphQLInt }, @@ -224,13 +224,13 @@ const pageRestaurantSpecialtiesType = new GraphQLObjectType({ }) }); -const coverPhotoType = require('./fbCoverPhotoType'); -const userType = require('./fbUserType'); -const albumType = require('./fbAlbumType'); -const photoType = require('./fbPhotoType'); -const eventType = require('./fbEventType'); -const locationType = require('./fbLocationType'); -const postType = require('./fbPostType'); -const likeType = require('./fbLikeType'); -const videoType = require('./fbVideoType'); -const profilePictureType = require('./fbProfilePicType'); \ No newline at end of file +const fbCoverPhotoType = require('./fbCoverPhotoType'); +const fbUserType = require('./fbUserType'); +const fbAlbumType = require('./fbAlbumType'); +const fbPhotoType = require('./fbPhotoType'); +const fbEventType = require('./fbEventType'); +const fbLocationType = require('./fbLocationType'); +const fbPostType = require('./fbPostType'); +const fbLikeType = require('./fbLikeType'); +const fbVideoType = require('./fbVideoType'); +const fbProfilePictureType = require('./fbProfilePicType'); \ No newline at end of file diff --git a/data/schema/facebook-type/fbPhotoType.js b/data/schema/facebook-type/fbPhotoType.js index 5303795..7852223 100644 --- a/data/schema/facebook-type/fbPhotoType.js +++ b/data/schema/facebook-type/fbPhotoType.js @@ -8,8 +8,8 @@ var { var getField = require('../../../API/fbAPI').getField; var getEdge = require('../../../API/fbAPI').getEdge; -const photoType = module.exports = new GraphQLObjectType({ - name: 'photo', +const fbPhotoType = module.exports = new GraphQLObjectType({ + name: 'fbPhoto', description: 'Return a facebook photo.', fields: () => ({ id: { type: GraphQLString }, @@ -34,38 +34,38 @@ const photoType = module.exports = new GraphQLObjectType({ backdated_time_granularity: { type: GraphQLString, resolve: ({id}) => getField({id},'backdated_time_granularity')}, - images: { type: new GraphQLList(platformImageSourceType), + images: { type: new GraphQLList(fbPlatformImageSourceType), resolve: ({id}) => getField({id},'images')}, - name_tags: { type: new GraphQLList(entityAtTextRangeType), + name_tags: { type: new GraphQLList(fbEntityAtTextRangeType), resolve: ({id}) => getField({id},'name_tags')}, - webp_images: { type: new GraphQLList(platformImageSourceType), + webp_images: { type: new GraphQLList(fbPlatformImageSourceType), resolve: ({id}) => getField({id},'webp_images')}, - album: { type: albumType, + album: { type: fbAlbumType, resolve: ({id}) => getField({id},'album')}, - from: { type: profileType, + from: { type: fbProfileType, resolve: ({id}) => getField({id},'from')}, - event: { type: eventType, + event: { type: fbEventType, resovle: ({id}) => getField({id},'event')}, - place: { type: placeType, + place: { type: fbPlaceType, resolve: ({id}) => getField({id},'place')}, /*-------------------------- edges ---------------------------------- */ - reactions: { type: new GraphQLList(reactionType), + reactions: { type: new GraphQLList(fbReactionType), resolve: ({id}) => getEdge({id},'reactions')}, - sharedposts: { type: new GraphQLList(postType), + sharedposts: { type: new GraphQLList(fbPostType), resolve: ({id}) => getEdge({id},'sharedposts')}, - sponsor_tags: { type: new GraphQLList(pageType), + sponsor_tags: { type: new GraphQLList(fbPageType), resolve: ({id}) => getEdge({id},'sponsor_tags')}, - tags: { type: new GraphQLList(taggableSubjectType), + tags: { type: new GraphQLList(fbTaggableSubjectType), resolve: ({id}) => getEdge({id},'tags')}, - 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 platformImageSourceType = new GraphQLObjectType({ - name:'platformImageSource', +const fbPlatformImageSourceType = new GraphQLObjectType({ + name:'fbPlatformImageSource', description: `The different stored representations of the photo. Can vary in number based upon the size of the original photo.`, fields: ()=>({ @@ -74,8 +74,8 @@ const platformImageSourceType = new GraphQLObjectType({ source: { type: GraphQLString} }) }); -const taggableSubjectType = new GraphQLObjectType({ - name:'taggableSubject', +const fbTaggableSubjectType = new GraphQLObjectType({ + name:'fbTaggableSubject', description:'Represents an object can be tagged in some content', fields:()=>({ id: {type:GraphQLString}, @@ -86,17 +86,17 @@ const taggableSubjectType = new GraphQLObjectType({ }) }); -const entityAtTextRangeType = require('./fbEntityAtTextRangeType'); -const albumType = require('./fbAlbumType'); -const userType = require('./fbUserType'); -const eventType = require('./fbEventType'); -const placeType = require('./fbPlaceType'); -const commentType = require('./fbCommentType'); -const likeType = require('./fbLikeType'); -const reactionType = require('./fbReactionType'); -const postType = require('./fbPostType'); -const pageType = require('./fbPageType'); -const profileType = require('./fbProfileType'); +const fbEntityAtTextRangeType = require('./fbEntityAtTextRangeType'); +const fbAlbumType = require('./fbAlbumType'); +const fbUserType = require('./fbUserType'); +const fbEventType = require('./fbEventType'); +const fbPlaceType = require('./fbPlaceType'); +const fbCommentType = require('./fbCommentType'); +const fbLikeType = require('./fbLikeType'); +const fbReactionType = require('./fbReactionType'); +const fbPostType = require('./fbPostType'); +const fbPageType = require('./fbPageType'); +const fbProfileType = require('./fbProfileType'); diff --git a/data/schema/facebook-type/fbPlaceTopicType.js b/data/schema/facebook-type/fbPlaceTopicType.js index d63b3f8..9461cc5 100644 --- a/data/schema/facebook-type/fbPlaceTopicType.js +++ b/data/schema/facebook-type/fbPlaceTopicType.js @@ -9,8 +9,8 @@ var { var getField = require('../../../API/fbAPI').getField; var getEdge = require('../../../API/fbAPI').getEdge; -const placeTopicType = module.exports = new GraphQLObjectType({ - name: 'placeTopic', +const fbPlaceTopicType = module.exports = new GraphQLObjectType({ + name: 'fbPlaceTopic', description: 'Reading the category of a place Page.', fields: () => ({ /*------------------------------fields-------------------------------*/ diff --git a/data/schema/facebook-type/fbPlaceType.js b/data/schema/facebook-type/fbPlaceType.js index c871811..da83be1 100644 --- a/data/schema/facebook-type/fbPlaceType.js +++ b/data/schema/facebook-type/fbPlaceType.js @@ -8,17 +8,17 @@ var { var getField = require('../../../API/fbAPI').getField; var getEdge = require('../../../API/fbAPI').getEdge; -const placeType = module.exports = new GraphQLObjectType({ - name:'place', +const fbPlaceType = module.exports = new GraphQLObjectType({ + name:'fbPlace', description:'return a Facebook place', fields: ()=>({ /*---------------------------fields----------------------*/ id: { type: GraphQLString }, name: { type: GraphQLString }, - location: { type: locationType, + location: { type: fbLocationType, resolve: ({id}) => getField({id},'location')} /*---------------------------no edges---------------------*/ }) }); -const locationType = require('./fbLocationType'); +const fbLocationType = require('./fbLocationType'); diff --git a/data/schema/facebook-type/fbPostType.js b/data/schema/facebook-type/fbPostType.js index ce71c5b..bbb6d16 100644 --- a/data/schema/facebook-type/fbPostType.js +++ b/data/schema/facebook-type/fbPostType.js @@ -9,8 +9,8 @@ var { var getField = require('../../../API/fbAPI').getField; var getEdge = require('../../../API/fbAPI').getEdge; -const postType = module.exports = new GraphQLObjectType({ - name: 'post', +const fbPostType = module.exports = new GraphQLObjectType({ + name: 'fbPost', description: 'An individual entry in a profile\'s feed. The profile could be a user, page, app, or group.', fields: () => ({ /*----------------------------fields----------------------------------*/ @@ -21,7 +21,7 @@ const postType = module.exports = new GraphQLObjectType({ resolve: ({id}) => getField({id},'created_time')}, description: {type:GraphQLString, resolve: ({id}) => getField({id},'description')}, - from: {type:profileType, + from: {type:fbProfileType, resolve: ({id}) => getField({id},'from')}, icon: {type:GraphQLString, resolve: ({id}) => getField({id},'icon')}, @@ -39,7 +39,7 @@ const postType = module.exports = new GraphQLObjectType({ resolve: ({id}) => getField({id},'permalink_url')}, picture: {type:GraphQLString, resolve: ({id}) => getField({id},'picture')}, - place: {type:placeType, + place: {type:fbPlaceType, resolve: ({id}) => getField({id},'place')}, share: {type:GraphQLInt, resolve: ({id}) => getField({id},'share')}, @@ -49,33 +49,33 @@ const postType = module.exports = new GraphQLObjectType({ resolve: ({id}) => getField({id},'status_type')}, story: {type:GraphQLString, resolve: ({id}) => getField({id},'story')}, - to: {type:new GraphQLList(profileType), + to: {type:new GraphQLList(fbProfileType), resolve: ({id}) => getField({id},'to')}, type: {type:GraphQLString, resolve: ({id}) => getField({id},'type')}, updated_time: {type:GraphQLString, resolve: ({id}) => getField({id},'updated_time')}, - with_tags: {type:new GraphQLList(userType), + with_tags: {type:new GraphQLList(fbUserType), resolve: ({id}) => getField({id},'with_tags')}, /*------------------------------edges--------------------------------*/ - 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')}, - sharedposts: { type: new GraphQLList(postType), + sharedposts: { type: new GraphQLList(fbPostType), resolve: ({id}) => getEdge({id},'sharedposts')}, - attachments: { type: new GraphQLList(attachmentType), + attachments: { type: new GraphQLList(fbAttachmentType), resolve: ({id}) => getEdge({id},'attachments')} }) }); -const userType = require('./fbUserType'); -const placeType = require('./fbPlaceType'); -const likeType = require('./fbLikeType'); -const reactionType = require('./fbReactionType'); -const commentType = require('./fbCommentType'); -const attachmentType = require('./fbAttachmentType'); -const profileType = require('./fbProfileType'); +const fbUserType = require('./fbUserType'); +const fbPlaceType = require('./fbPlaceType'); +const fbLikeType = require('./fbLikeType'); +const fbReactionType = require('./fbReactionType'); +const fbCommentType = require('./fbCommentType'); +const fbAttachmentType = require('./fbAttachmentType'); +const fbProfileType = require('./fbProfileType'); \ No newline at end of file diff --git a/data/schema/facebook-type/fbProfilePicType.js b/data/schema/facebook-type/fbProfilePicType.js index 430e6d7..f2ac6ca 100644 --- a/data/schema/facebook-type/fbProfilePicType.js +++ b/data/schema/facebook-type/fbProfilePicType.js @@ -9,8 +9,8 @@ var { var getField = require('../../../API/fbAPI').getField; var getEdge = require('../../../API/fbAPI').getEdge; -const profilePictureType = module.exports = new GraphQLObjectType({ - name: 'profilePic', +const fbProfilePictureType = module.exports = new GraphQLObjectType({ + name: 'fbProfilePic', description: 'Profile Picture.', fields: () => ({ height: {type:GraphQLInt}, diff --git a/data/schema/facebook-type/fbProfileType.js b/data/schema/facebook-type/fbProfileType.js index 134a9e1..fa657b0 100644 --- a/data/schema/facebook-type/fbProfileType.js +++ b/data/schema/facebook-type/fbProfileType.js @@ -9,14 +9,14 @@ var { } = require('graphql'); -const userType = require('./fbUserType'); -const pageType = require('./fbPageType'); +const fbUserType = require('./fbUserType'); +const fbPageType = require('./fbPageType'); const resolveType = (data) => { if (data.first_name){ - return userType; + return fbUserType; }else{ - return pageType; + return fbPageType; } }; @@ -24,7 +24,7 @@ const fbProfileType = module.exports = new GraphQLUnionType({ name: 'fbProfile', description: `a list of profile node: User,Page,Group,Event,Application can be keep working on e.g. userType|pageType|groupType|eventType|`, - types: [userType, pageType], + types: [fbUserType, fbPageType], resolveType: resolveType }); diff --git a/data/schema/facebook-type/fbReactionType.js b/data/schema/facebook-type/fbReactionType.js index c9bcd6e..c871a08 100644 --- a/data/schema/facebook-type/fbReactionType.js +++ b/data/schema/facebook-type/fbReactionType.js @@ -9,8 +9,8 @@ var { var getField = require('../../../API/fbAPI').getField; var getEdge = require('../../../API/fbAPI').getEdge; -const reactionType = module.exports = new GraphQLObjectType({ - name: 'reaction', +const fbReactionType = module.exports = new GraphQLObjectType({ + name: 'fbReaction', description: 'type enum {NONE, LIKE, LOVE, WOW, HAHA, SAD, ANGRY, THANKFUL}.', fields: () => ({ id: {type: GraphQLString}, diff --git a/data/schema/facebook-type/fbThumbnailType.js b/data/schema/facebook-type/fbThumbnailType.js index c1c941d..b49dc79 100644 --- a/data/schema/facebook-type/fbThumbnailType.js +++ b/data/schema/facebook-type/fbThumbnailType.js @@ -9,8 +9,8 @@ var { var getField = require('../../../API/fbAPI').getField; var getEdge = require('../../../API/fbAPI').getEdge; -const thumbnailType = module.exports = new GraphQLObjectType({ - name: 'thumbnail', +const fbThumbnailType = module.exports = new GraphQLObjectType({ + name: 'fbThumbnail', description: 'Represents an video\'s thumbnail on Facebook.', fields: () => ({ /*-----------------------------------field---------------------------------*/ diff --git a/data/schema/facebook-type/fbUserType.js b/data/schema/facebook-type/fbUserType.js index 0f81e22..9a77817 100644 --- a/data/schema/facebook-type/fbUserType.js +++ b/data/schema/facebook-type/fbUserType.js @@ -9,7 +9,7 @@ var { var getField = require('../../../API/fbAPI').getField; var getEdge = require('../../../API/fbAPI').getEdge; -const userType = module.exports = new GraphQLObjectType({ +const fbUserType = module.exports = new GraphQLObjectType({ name: 'fbUser', description: 'Return a facebook user.', fields: () => ({ @@ -50,70 +50,70 @@ const userType = module.exports = new GraphQLObjectType({ website: { type: GraphQLString, resolve: ({id}) => getField({id},'website')}, - age_range: { type: ageType, + age_range: { type: fbAgeType, resolve: ({id}) => getField({id},'age_range')}, - cover: { type: coverPhotoType, + cover: { type: fbCoverPhotoType, resolve: ({id}) => getField({id},'cover')}, - currency: { type: currencyType, + currency: { type: fbCurrencyType, resolve: ({id}) => getField({id},'currency')}, - devices: { type: new GraphQLList(deviceType), + devices: { type: new GraphQLList(fbDeviceType), resolve: ({id}) => getField({id},'devices')}, - education: { type: new GraphQLList(educationExpType), + education: { type: new GraphQLList(fbEducationExpType), resolve: ({id}) => getField({id},'education')}, favorite_athletes: { - type: new GraphQLList(experienceType), + type: new GraphQLList(fbExperienceType), resolve: ({id}) => getField({id},'favorite_athletes')}, - favorite_teams: { type: new GraphQLList(experienceType), + favorite_teams: { type: new GraphQLList(fbExperienceType), resolve: ({id}) => getField({id},'favorite_teams')}, - hometown: { type: pageType, + hometown: { type: fbPageType, resolve: ({id}) => getField({id},'hometown')}, inspirational_people: { - type: new GraphQLList(experienceType), + type: new GraphQLList(fbExperienceType), resolve: ({id}) => getField({id},'inspirational_people')}, interested_in: { type: new GraphQLList(GraphQLString), resolve: ({id}) => getField({id},'interested_in')}, - languages: { type: new GraphQLList(experienceType), + languages: { type: new GraphQLList(fbExperienceType), resolve: ({id}) => getField({id},'languages')}, - location: { type: pageType, + location: { type: fbPageType, resolve: ({id}) => getField({id},'location')}, meeting_for: { type: new GraphQLList(GraphQLString), resolve: ({id}) => getField({id},'meeting_for')}, significant_other: { - type: userType, + type: fbUserType, resolve: ({id}) => getField({id},'significant_other')}, - sports: { type: new GraphQLList(experienceType), + sports: { type: new GraphQLList(fbExperienceType), resolve: ({id}) => getField({id},'sports')}, - work: { type: new GraphQLList(experienceType), + work: { type: new GraphQLList(fbExperienceType), resolve: ({id}) => getField({id},'work')}, /*------------------------------------EDGES---------------------------------*/ - albums: { type: new GraphQLList(albumType), + albums: { type: new GraphQLList(fbAlbumType), resolve: ({id}) => getEdge({id},'albums')}, - photos: { type: new GraphQLList(photoType), + photos: { type: new GraphQLList(fbPhotoType), resolve: ({id}) => getEdge({id},'photos')}, - events: { type: new GraphQLList(eventType), + events: { type: new GraphQLList(fbEventType), resolve: ({id}) => getEdge({id},'events')}, - locations: { type: new GraphQLList(locationType), + locations: { type: new GraphQLList(fbLocationType), resolve: ({id}) => getEdge({id},'locations')}, - groups: { type: new GraphQLList(groupType), + groups: { type: new GraphQLList(fbGroupType), resolve: ({id}) => getEdge({id},'groups')}, - family: { type: new GraphQLList(userType), + family: { type: new GraphQLList(fbUserType), resolve: ({id}) => getEdge({id},'family')}, - friends: { type: new GraphQLList(userType), + friends: { type: new GraphQLList(fbUserType), resolve: ({id}) => getEdge({id},'friends')}, - likes: { type: new GraphQLList(likeType), + likes: { type: new GraphQLList(fbLikeType), resolve: ({id}) => getEdge({id},'likes')}, - 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')}, - picture: { type: profilePictureType, + picture: { type: fbProfilePictureType, resolve: ({id}) => getEdge({id},'picture')} }) }); -const ageType = new GraphQLObjectType({ - name: 'age', +const fbAgeType = new GraphQLObjectType({ + name: 'fbAge', description: 'Return a facebook user\'s age range.', fields: () => ({ max: { type: GraphQLInt }, @@ -121,8 +121,8 @@ const ageType = new GraphQLObjectType({ }) }); -const currencyType = new GraphQLObjectType({ - name: 'currency', +const fbCurrencyType = new GraphQLObjectType({ + name: 'fbCurrency', description: 'Return a facebook user\'s local currency information.', fields: () => ({ usd_exchange: { type: GraphQLFloat}, @@ -131,8 +131,8 @@ const currencyType = new GraphQLObjectType({ }) }); -const deviceType = new GraphQLObjectType({ - name:'device', +const fbDeviceType = new GraphQLObjectType({ + name:'fbDevice', description: 'return a list of devices the person is using. thiw will return only IOS and Android devices', fields: ()=>({ hardware: { type: GraphQLString }, @@ -140,32 +140,32 @@ const deviceType = new GraphQLObjectType({ }) }); -const educationExpType = new GraphQLObjectType({ - name:'educationExp', +const fbEducationExpType = new GraphQLObjectType({ + name:'fbEducationExp', description:'the person\'s education', fields: ()=>({ id: { type: GraphQLString }, - classes: { type: new GraphQLList(experienceType) }, - concentration: { type: new GraphQLList(pageType) }, - degree: { type: pageType }, - school: {type: pageType }, + classes: { type: new GraphQLList(fbExperienceType) }, + concentration: { type: new GraphQLList(fbPageType) }, + degree: { type: fbPageType }, + school: {type: fbPageType }, type: {type: GraphQLString }, - with: { type: new GraphQLList(userType) }, - year: { type: new GraphQLList(pageType) } + with: { type: new GraphQLList(fbUserType) }, + year: { type: new GraphQLList(fbPageType) } }) }); //write require at the bottom to solve the circular dependency problem -const experienceType = require('./fbExpType'); -const pageType = require('./fbPageType'); -const albumType = require('./fbAlbumType'); -const photoType = require('./fbPhotoType'); -const eventType = require('./fbEventType'); -const coverPhotoType = require('./fbCoverPhotoType'); -const locationType = require('./fbLocationType'); -const groupType = require('./fbGroupType'); -const likeType = require('./fbLikeType'); -const videoType = require('./fbVideoType'); -const postType = require('./fbPostType'); -const profilePictureType = require('./fbProfilePicType'); +const fbExperienceType = require('./fbExpType'); +const fbPageType = require('./fbPageType'); +const fbAlbumType = require('./fbAlbumType'); +const fbPhotoType = require('./fbPhotoType'); +const fbEventType = require('./fbEventType'); +const fbCoverPhotoType = require('./fbCoverPhotoType'); +const fbLocationType = require('./fbLocationType'); +const fbGroupType = require('./fbGroupType'); +const fbLikeType = require('./fbLikeType'); +const fbVideoType = require('./fbVideoType'); +const fbPostType = require('./fbPostType'); +const fbProfilePictureType = require('./fbProfilePicType'); diff --git a/data/schema/facebook-type/fbVideoType.js b/data/schema/facebook-type/fbVideoType.js index d7c5e54..ac5c615 100644 --- a/data/schema/facebook-type/fbVideoType.js +++ b/data/schema/facebook-type/fbVideoType.js @@ -9,8 +9,8 @@ var { var getField = require('../../../API/fbAPI').getField; var getEdge = require('../../../API/fbAPI').getEdge; -const videoType = module.exports = new GraphQLObjectType({ - name: 'video', +const fbVideoType = module.exports = new GraphQLObjectType({ + name: 'fbVideo', description: 'Represents an individual video on Facebook.', fields: () => ({ /*-----------------------------------fields--------------------------*/ @@ -26,12 +26,12 @@ const videoType = module.exports = new GraphQLObjectType({ id: {type:GraphQLString}, backdated_time: {type:GraphQLString, resolve: ({id}) => getField({id},'backdated_time')}, - event: {type:eventType, + event: {type:fbEventType, resolve: ({id}) => getField({id},'event')}, - format: {type: new GraphQLList(videoFormatType), + format: {type: new GraphQLList(fbVideoFormatType), resolve: ({id}) => getField({id},'format')}, from: {// profile - type:profileType, + type:fbProfileType, resolve: ({id}) => getField({id},'from')}, icon: {type:GraphQLString, resolve: ({id}) => getField({id},'icon')}, @@ -41,7 +41,7 @@ const videoType = module.exports = new GraphQLObjectType({ resolve: ({id}) => getField({id},'permalink_url')}, picture: {type:GraphQLString, resolve: ({id}) => getField({id},'picture')}, - place: {type:placeType, + place: {type:fbPlaceType, resolve: ({id}) => getField({id},'place')}, source: {type:GraphQLString, resolve: ({id}) => getField({id},'source')}, @@ -51,26 +51,26 @@ const videoType = module.exports = new GraphQLObjectType({ resolve: ({id}) => getField({id},'universal_video_id')}, updated_time: {type:GraphQLString}, /*---------------------------------edges----------------------*/ - captions: { type: new GraphQLList(videoCaptionType), + captions: { type: new GraphQLList(fbVideoCaptionType), resolve: ({id}) => getEdge({id},'captions')}, - comments: { type: new GraphQLList(commentType), + comments: { type: new GraphQLList(fbCommentType), resolve: ({id}) => getEdge({id},'comments')}, - 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')}, - sharedposts: { type: new GraphQLList(postType), + sharedposts: { type: new GraphQLList(fbPostType), resolve: ({id}) => getEdge({id},'sharedposts')}, - sponsor_tags: { type: new GraphQLList(pageType), + sponsor_tags: { type: new GraphQLList(fbPageType), resolve: ({id}) => getEdge({id},'sponsor_tags')}, - tags: { type: new GraphQLList(taggableSubjectType2), + tags: { type: new GraphQLList(fbTaggableSubjectType2), resolve: ({id}) => getEdge({id},'tags')}, - thumbnails: { type: new GraphQLList(thumnailType), + thumbnails: { type: new GraphQLList(fbThumnailType), resolve: ({id}) => getEdge({id},'thumbnails')} }) }); -const taggableSubjectType2 = new GraphQLObjectType({ - name:'taggableSubject2', +const fbTaggableSubjectType2 = new GraphQLObjectType({ + name:'fbTaggableSubject2', description:'Represents an object can be tagged in some content', fields:()=>({ id: {type:GraphQLString}, @@ -78,8 +78,8 @@ const taggableSubjectType2 = new GraphQLObjectType({ created_time: {type:GraphQLString} }) }); -const videoFormatType = new GraphQLObjectType({ - name:'videoFormat', +const fbVideoFormatType = new GraphQLObjectType({ + name:'fbVideoFormat', description:'The different formats of the video.', fields: ()=>({ embed_html: {type:GraphQLString}, @@ -89,8 +89,8 @@ const videoFormatType = new GraphQLObjectType({ width: {type:GraphQLInt} }) }); -const videoCaptionType = new GraphQLObjectType({ - name:'videoCaption', +const fbVideoCaptionType = new GraphQLObjectType({ + name:'fbVideoCaption', description:'Captions for the video.', fields: ()=>({ created_time: {type:GraphQLInt}, @@ -99,15 +99,15 @@ const videoCaptionType = new GraphQLObjectType({ url: {type:GraphQLString} }) }); -const eventType = require('./fbEventType'); -const userType = require('./fbUserType'); -const placeType = require('./fbPlaceType'); -const commentType = require('./fbCommentType'); -const likeType = require('./fbLikeType'); -const reactionType = require('./fbReactionType'); -const postType = require('./fbPostType'); -const pageType = require('./fbPageType'); -const thumnailType = require('./fbThumbnailType'); -const profileType = require('./fbProfileType'); +const fbEventType = require('./fbEventType'); +const fbUserType = require('./fbUserType'); +const fbPlaceType = require('./fbPlaceType'); +const fbCommentType = require('./fbCommentType'); +const fbLikeType = require('./fbLikeType'); +const fbReactionType = require('./fbReactionType'); +const fbPostType = require('./fbPostType'); +const fbPageType = require('./fbPageType'); +const fbThumnailType = require('./fbThumbnailType'); +const fbProfileType = require('./fbProfileType'); //console.log(profileType); diff --git a/data/schema/fbSchema.js b/data/schema/fbSchema.js index 740a5e3..7f88f82 100644 --- a/data/schema/fbSchema.js +++ b/data/schema/fbSchema.js @@ -13,42 +13,42 @@ const fbQueryType = module.exports = new GraphQLObjectType({ description:'Query user, page, event, group, place, placetopic.', fields: () => ({ queryUser:{ - type: new GraphQLList(userType), + type: new GraphQLList(fbUserType), args:{ q: { type:GraphQLString } }, resolve: (_,args) => search(args,'user') }, queryPage:{ - type: new GraphQLList(pageType), + type: new GraphQLList(fbPageType), args:{ q: { type:GraphQLString } }, resolve: (_,args) => search(args,'page') }, queryPlace: { - type: new GraphQLList(placeType), + type: new GraphQLList(fbPlaceType), args:{ q: { type:GraphQLString } }, resolve: (_,args) => search(args,'place') }, queryEvent: { - type: new GraphQLList(eventType), + type: new GraphQLList(fbEventType), args:{ q: { type:GraphQLString } }, resolve: (_,args) => search(args,'event') }, queryGroup: { - type: new GraphQLList(groupType), + type: new GraphQLList(fbGroupType), args:{ q: { type:GraphQLString } }, resolve: (_,args) => search(args,'group') }, queryPlaceTopic:{ - type: new GraphQLList(placeTopicType), + type: new GraphQLList(fbPlaceTopicType), args:{ q: { type:GraphQLString } }, resolve: (_,args) => search(args,'placetopic') } }) }); -const userType = require('./facebook-type/fbUserType'); -const pageType = require('./facebook-type/fbPageType'); -const eventType = require('./facebook-type/fbEventType'); -const placeType = require('./facebook-type/fbPlaceType'); -const groupType = require('./facebook-type/fbGroupType'); -const placeTopicType = require('./facebook-type/fbPlaceTopicType'); +const fbUserType = require('./facebook-type/fbUserType'); +const fbPageType = require('./facebook-type/fbPageType'); +const fbEventType = require('./facebook-type/fbEventType'); +const fbPlaceType = require('./facebook-type/fbPlaceType'); +const fbGroupType = require('./facebook-type/fbGroupType'); +const fbPlaceTopicType = require('./facebook-type/fbPlaceTopicType'); diff --git a/data/schema/twitter-type/twtEntityType.js b/data/schema/twitter-type/twtEntityType.js index b637ed5..d4aa1bb 100644 --- a/data/schema/twitter-type/twtEntityType.js +++ b/data/schema/twitter-type/twtEntityType.js @@ -6,8 +6,8 @@ var { GraphQLInt } = require('graphql'); -const entityType = module.exports = new GraphQLObjectType({ - name : 'entity', +const twtEntityType = module.exports = new GraphQLObjectType({ + name : 'twtEntity', description : 'entity of a tweet or user', fields : () => ({ /*--------------------------basic------------------------*/ @@ -29,8 +29,8 @@ const entityType = module.exports = new GraphQLObjectType({ return tag_list } }, - user_mentions: { type: new GraphQLList(userType)}, + user_mentions: { type: new GraphQLList(twtUserType)}, }) }); -const userType = require('./twtUserType'); \ No newline at end of file +const twtUserType = require('./twtUserType'); \ No newline at end of file diff --git a/data/schema/twitter-type/twtGeoType.js b/data/schema/twitter-type/twtGeoType.js index d9fd483..f428564 100644 --- a/data/schema/twitter-type/twtGeoType.js +++ b/data/schema/twitter-type/twtGeoType.js @@ -6,8 +6,8 @@ var { GraphQLInt } = require('graphql'); -const geoType = module.exports = new GraphQLObjectType({ - name: 'geo', +const twtGeoType = module.exports = new GraphQLObjectType({ + name: 'twtGeo', description: `Search for places that can be attached to a statuses/update. Given a latitude and a longitude pair, an IP address, or a name, this request will return a list of all the valid places that can be used as the place_ @@ -23,7 +23,7 @@ const geoType = module.exports = new GraphQLObjectType({ place_type: {type: GraphQLString }, url: {type: GraphQLString }, /*--------------------------nested------------------------*/ - contained_within: {type: new GraphQLList(geoType) } + contained_within: {type: new GraphQLList(twtGeoType) } }) }); diff --git a/data/schema/twitter-type/twtRetweetType.js b/data/schema/twitter-type/twtRetweetType.js index 05a477a..88c7259 100644 --- a/data/schema/twitter-type/twtRetweetType.js +++ b/data/schema/twitter-type/twtRetweetType.js @@ -21,12 +21,12 @@ const retweetType = module.exports = new GraphQLObjectType({ favorite_count: { type: GraphQLInt }, retweet_count: { type: GraphQLInt }, /*--------------------------nested------------------------*/ - entities: { type: entityType }, + entities: { type: twtEntityType }, retweeted_status: { type: tweetType }, - user: { type: userType } + user: { type: twtUserType } }) }); -const userType = require('./twtUserType'); -const entityType = require('./twtEntityType'); +const twtUserType = require('./twtUserType'); +const twtEntityType = require('./twtEntityType'); const tweetType = require('./twtTweetType'); \ No newline at end of file diff --git a/data/schema/twitter-type/twtTweetType.js b/data/schema/twitter-type/twtTweetType.js index b018c93..fff9ece 100644 --- a/data/schema/twitter-type/twtTweetType.js +++ b/data/schema/twitter-type/twtTweetType.js @@ -22,8 +22,8 @@ const tweetType = module.exports = new GraphQLObjectType({ in_reply_to_status_id_str: { type: GraphQLString }, in_reply_to_screen_name: { type: GraphQLString }, /*--------------------------nested------------------------*/ - user: { type: userType }, - entities: { type: entityType }, + user: { type: twtUserType }, + entities: { type: twtEntityType }, retweet: { type: new GraphQLList(retweetType), description: 'Get a list of retweets', @@ -33,6 +33,6 @@ const tweetType = module.exports = new GraphQLObjectType({ }) }); -const userType = require('./twtUserType'); -const entityType = require('./twtEntityType'); +const twtUserType = require('./twtUserType'); +const twtEntityType = require('./twtEntityType'); const retweetType = require('./twtRetweetType'); \ No newline at end of file diff --git a/data/schema/twitter-type/twtUserType.js b/data/schema/twitter-type/twtUserType.js index cce7b75..f3f7f1b 100644 --- a/data/schema/twitter-type/twtUserType.js +++ b/data/schema/twitter-type/twtUserType.js @@ -12,8 +12,8 @@ var { fetchFriend } = require('../../../API/twitterAPI'); -const userType = module.exports = new GraphQLObjectType({ - name: 'user', +const twtUserType = module.exports = new GraphQLObjectType({ + name: 'twtUser', description: 'Return a twitter user.', fields: () => ({ /*--------------------------basic------------------------*/ @@ -44,13 +44,13 @@ const userType = module.exports = new GraphQLObjectType({ resolve:(user,args) =>fetchTimeline(user,args) }, friends: { - type: new GraphQLList(userType), + type: new GraphQLList(twtUserType), args:{count:{type:GraphQLInt,defaultValue:3}}, description: 'Get a list of followees of current User', resolve:(user,args) => fetchFriend(user,args) }, followers: { - type: new GraphQLList(userType), + type: new GraphQLList(twtUserType), args:{count:{type:GraphQLInt,defaultValue:3}}, description: 'Get a list of followers of current User', resolve:(user,args) => fetchFollower(user,args) diff --git a/data/schema/twitterSchema.js b/data/schema/twitterSchema.js index 43ad5d7..ca7396c 100644 --- a/data/schema/twitterSchema.js +++ b/data/schema/twitterSchema.js @@ -18,7 +18,7 @@ const twitterQueryType = module.exports = new GraphQLObjectType({ description:'Query user, tweet, geolocation by keywords.', fields: () => ({ queryUser:{ - type: new GraphQLList(userType), + type: new GraphQLList(twtUserType), args:{ q: { type:GraphQLString, description:'The search query to run against people search.' @@ -81,7 +81,7 @@ const twitterQueryType = module.exports = new GraphQLObjectType({ resolve: (_,args) => searchTweet(args) }, queryGeo: { - type: new GraphQLList(geoType), + type: new GraphQLList(twtGeoType), args:{ query: { type:GraphQLString, @@ -131,8 +131,8 @@ const twitterQueryType = module.exports = new GraphQLObjectType({ }) }); -const userType = require('./twitter-type/twtUserType'); +const twtUserType = require('./twitter-type/twtUserType'); const tweetType = require('./twitter-type/twtTweetType'); -const geoType = require('./twitter-type/twtGeoType'); +const twtGeoType = require('./twitter-type/twtGeoType'); module.exports = twitterQueryType; \ No newline at end of file