-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Adding in restify integration, docs, tests more... #189
Adding in restify integration, docs, tests more... #189
Conversation
Appears coveralls isn't yet working. Here's the coverage stats after this PR:
|
Hey folks, this has been sitting for a few weeks, any thoughts/concerns/comments? |
I'll take a look at it soon! Thanks for the reminder. |
@joelgriffith Thanks, it looks good at first glance! What were the necessary changes compared to the express version? It might be helpful to point those out in comments in the code, because most of it looks very similar. |
@joelgriffith let's get this merged some time soon! I think we're pretty close, so it would be a shame if we dropped it now. |
Hi. Any idea when this PR might get merged? I understand it's possible to use the express variant with restify, but it would be cleaner to have a restify variant out of the box. I've pulled down @joelgriffith's fork to try locally (though running into a schema issue, but that's most likely because I'm new to GraphQL). Thanks. |
Haha @DxCx, did I say I wanted to take this over? I will see, given time constraints. |
well @jadkap, you already downloaded it locally to try it off, if you make it work, why not contribute it back ;) |
Hey folks, sorry, been tied up. I'm lost on where this is... I only see a conflict in CHANGELOG.md, I can fix whatever and push? |
@joelgriffith , you better hold on for #180 which will be merged any time now, |
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.
Also, after #180 rebase, it might be best to refactor index out to 2 files (index and restifyApollo) and rename test file to restifyApollo.test.ts, to be more consistent with other variants.
|
||
server.post('/graphql', graphqlRestify({ schema: myGraphQLSchema })); | ||
|
||
sever.get('/graphiql', graphiqlRestify({ endpointURL: '/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.
fix typo
"typed-graphql": "^1.0.2" | ||
}, | ||
"peerDependencies": { | ||
"graphql": "^0.6.1 || ^0.7.0" |
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.
add || ^0.8.0
0.5.1 branch is merged :) |
|
||
server.use(restify.bodyParser()); | ||
|
||
server.post('/graphql', graphqlRestify({ schema: myGraphQLSchema })); |
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.
should be use
as now apollo supports GET requests as well. :)
I'll take a stab at it later today, will push once everything is resolved |
great @joelgriffith thanks! 👍 |
Pushed my rebase and fixes. I'm not able to complete an install or run tests, so I'm not sure what the issue is:
|
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.
Thanks @joelgriffith
Ive commented in the code found some issues
Typings issue will probably fix the compilation for you..
}; | ||
} | ||
|
||
function isOptionsFunction(arg: GraphQLOptions | RestifyGraphQLOptionsFunction): arg is RestifyGraphQLOptionsFunction { |
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 think this function here can be removed
It moved to core.. please check that ;)
"node_modules/@types" | ||
], | ||
"types": [ | ||
"typed-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.
Should be removed
"@types/restify": "^2.0.33", | ||
"graphql-server-integration-testsuite": "^0.4.3", | ||
"restify": "^4.1.1", | ||
"typed-graphql": "^1.0.2" |
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.
Should be replaced with @types/graphql
"graphql": "^0.6.1 || ^0.7.0 || ^0.8.0" | ||
}, | ||
"optionalDependencies": { | ||
"@types/restify": "^2.0.33" |
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.
Should add @types/graphql
server.get('/graphiql', graphiqlRestify( options.graphiqlOptions )); | ||
} | ||
server.post('/graphql', graphqlRestify( options.graphqlOptions )); | ||
server.put('/graphql', graphqlRestify( options.graphqlOptions )); |
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.
Why put and not use?
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.
Can't namespace a .use
call: restify/node-restify#289
OK! Types are fixed, as are tests, and README. The interesting thing to note is that restify doesn't support namespacing of the |
Thanks @joelgriffith for fixing it up, and thanks @DxCx for fixing the travis issues. You guys are awesome! |
Thanks all for getting this merged. I was able to try latest and found a couple of things. (BTW, the "schema" issue I previously encountered was a symlink/node_modules issue.) @joelgriffith, if you have time, I'd appreciate your input on #285. |
Adds in restify, some new tests (would like to move these to a shared util and test in each integration). I've went through as much
md
files as I could to update fw support, but may have missed a place or two.Let me know your thoughts!
Closes #125