Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/facebook #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Feature/facebook #26

wants to merge 1 commit into from

Conversation

clayallsopp
Copy link
Owner

Starting work on a Facebook implementation; fixes #9

@clayallsopp clayallsopp force-pushed the feature/facebook branch 4 times, most recently from 1af4799 to f758cdd Compare March 30, 2016 18:32
@clayallsopp
Copy link
Owner Author

Hey @leebyron & @schrockn - any thoughts on this line of thinking? (wrapping the public Graph API into GraphQL)

Current schema looks like this, trying to be compatible with Relay where possible:

type FacebookAPI {
  viewer: FacebookUser
  node(id: ID!): Node
}

type FacebookPage implements Node, FacebookProfile {
  id: ID!
  metadataType: String!
  likes: Int
}

type FacebookPageConnection {
  pageInfo: PageInfo!
  edges: [FacebookPageEdge]
}

type FacebookPageEdge {
  node: FacebookPage
  cursor: String!
}

interface FacebookProfile {
  id: ID!
  metadataType: String!
}

type FacebookUser implements Node, FacebookProfile {
  id: ID!
  metadataType: String!
  name: String
  likes(after: String, first: Int, before: String, last: Int): FacebookPageConnection
}

interface Node {
  id: ID!
}

type PageInfo {
  hasNextPage: Boolean!
  hasPreviousPage: Boolean!
  startCursor: String
  endCursor: String
}

I think I can autogenerate lots of the fields and edges using the Graph API metadata, but things like cursors don't behave exactly the same (I.e. there seem to only be cursors per page, not per item)

connectionFromArray,
} from 'graphql-relay';

const getTokenFromAST = (ast) => {
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leebyron any advice or examples on a better way to do this? I want to pass in the API token once at some top-level field, and then ensure all subsequent API calls can access it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: a really complicated schema
1 participant