-
Notifications
You must be signed in to change notification settings - Fork 46
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
Twitter API proposal #4
Conversation
for WebStorm, PHPStorm, Node, SublimText.
Using GraphQLInt would return 'null'. Previous solution was to type them as GraphQLString. But, as Twitter API provides both fields 'id' and 'id_str', it seems important to distinguish them within this schema by picking up the right type.
Removed id_str field from graphiql initial query
This is awesome! Thank you so much for taking the time to come up with this, will leave some notes, but overall very excited It looks like Twit is yelling in the Travis builds yelling about missing environment variables; I think you should be able to add some fake ones to .travis.yml |
@@ -1,3 +1,157 @@ | |||
node_modules/ | |||
dist/ | |||
### WebStorm ### |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where did you pull this .gitignore from? My intuition is to use the github Node one, which covers more Node-specific things
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for this brutal change. I pulled it from gitignore.io to cover most of the files generated from Webstorm and other IDE's that contributors may use. This gitignore also contains Node's common ignore rules. But I could merge Webstorm and Node specific rules if you wish, tell me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotcha, that makes sense, can you add back in the line about "# Created by https://www.gitignore.io/api/webstorm,node" (which gives a bit more context/guides future users on how to edit it)
name: 'TwitterAPI', | ||
description: 'The Twitter API', | ||
fields: { | ||
user: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might prefer splitting this up into two fields - userById
and userByScreenName
, each with one GraphQLNonNull
arg (is there a way in the GraphQL.JS API to have "mutually exclusive" field arguments?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What you think about using a single arg wich is a custom GraphQLScalarType ?
https://facebook.github.io/graphql/#sec-Scalars
http://stackoverflow.com/questions/33819658/dynamic-unique-objects-in-graphql
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 good call
- Use an Enum type for proposing only ‘user_id’ or ‘screen_name’ - Identifier is a Scalar type with checks if the input data is either a String or an Integer.
@mr-wildcard anything else you want to do with this or good-to-merge? LGTM as-is |
hey @clayallsopp, if it's ok for you then it's ok for me :) let's |
It's alive! http://www.graphqlhub.com/playground/twitter |
This is a simple schema for Twitter API. As this API is quite vast, I only implemented three types:
User
,Tweet
,Retweet
with few available fields. I also added asearch
query with 3 parameters.Very simple tests have been provided for Twitter API, but I plan to add tests for
twitter
schema following graphql-js tests.