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

Adding in restify integration, docs, tests more... #189

Merged
merged 8 commits into from
Jan 24, 2017

Conversation

joelgriffith
Copy link

@joelgriffith joelgriffith commented Oct 24, 2016

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

@joelgriffith
Copy link
Author

Appears coveralls isn't yet working. Here's the coverage stats after this PR:

=============================== Coverage summary ===============================
Statements   : 98.21% ( 660/672 )
Branches     : 89.46% ( 297/332 )
Functions    : 100% ( 151/151 )
Lines        : 99.06% ( 631/637 )
================================================================================```

@joelgriffith
Copy link
Author

Hey folks, this has been sitting for a few weeks, any thoughts/concerns/comments?

@stubailo
Copy link
Contributor

stubailo commented Nov 7, 2016

I'll take a look at it soon! Thanks for the reminder.

@helfer
Copy link
Contributor

helfer commented Nov 29, 2016

@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.

@helfer
Copy link
Contributor

helfer commented Dec 7, 2016

@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.

@jadkap
Copy link
Contributor

jadkap commented Jan 10, 2017

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.

@DxCx
Copy link
Contributor

DxCx commented Jan 12, 2017

Hi @jadkap, im happy to see you want to take over this,
if you need any help (running into schema issues for example ;)) feel free to consult on slack (@HagaiCo)

@jadkap
Copy link
Contributor

jadkap commented Jan 17, 2017

Haha @DxCx, did I say I wanted to take this over? I will see, given time constraints.

@DxCx
Copy link
Contributor

DxCx commented Jan 17, 2017

well @jadkap, you already downloaded it locally to try it off, if you make it work, why not contribute it back ;)
and if you didn't make it work, as i said, you are welcome to reach me for consultant over slack :)

@joelgriffith
Copy link
Author

joelgriffith commented Jan 17, 2017

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?

@DxCx
Copy link
Contributor

DxCx commented Jan 18, 2017

@joelgriffith , you better hold on for #180 which will be merged any time now,
after you will rebase upon it, your integration code will look much much smaller.

Copy link
Contributor

@jadkap jadkap left a 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' }));
Copy link
Contributor

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"
Copy link
Contributor

Choose a reason for hiding this comment

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

add || ^0.8.0

@DxCx
Copy link
Contributor

DxCx commented Jan 19, 2017

0.5.1 branch is merged :)
@jadkap / @joelgriffith can one of you take over and rebase / align so we can merge?


server.use(restify.bodyParser());

server.post('/graphql', graphqlRestify({ schema: myGraphQLSchema }));
Copy link
Contributor

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. :)

@joelgriffith
Copy link
Author

I'll take a stab at it later today, will push once everything is resolved

@DxCx
Copy link
Contributor

DxCx commented Jan 19, 2017

great @joelgriffith thanks! 👍

@joelgriffith
Copy link
Author

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:

# jgriffith @ jgriffith in ~/Griffin/graphql-server on git:feature/restify-integration|MERGING x [11:46:51] C:1
$ npm i

> undefined postinstall /Users/jgriffith/Griffin/graphql-server
> lerna bootstrap

Lerna v2.0.0-beta.30
Bootstrapping 8 packages
Installing external dependencies
Errored while running BootstrapCommand.execute
npm ERR! Darwin 15.6.0
npm ERR! argv "/Users/jgriffith/.nvm/versions/node/v6.9.1/bin/node" "/Users/jgriffith/.nvm/versions/node/v6.9.1/bin/npm" "install" "@types/restify@^2.0.33" "graphql-server-integration-testsuite@^0.4.3" "restify@^4.1.1" "typed-graphql@^1.0.2" "graphql-server-core@^0.4.3"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.8
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/graphql-server-integration-testsuite
npm ERR! 404
npm ERR! 404  'graphql-server-integration-testsuite' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/jgriffith/Griffin/graphql-server/packages/graphql-server-restify/npm-debug.log

Copy link
Contributor

@DxCx DxCx left a 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 {
Copy link
Contributor

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",
Copy link
Contributor

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"
Copy link
Contributor

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"
Copy link
Contributor

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 ));
Copy link
Contributor

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?

Copy link
Author

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

@joelgriffith
Copy link
Author

OK! Types are fixed, as are tests, and README. The interesting thing to note is that restify doesn't support namespacing of the .use API, so you have to verbosely do a .get and a .post for query parsing and json parsing to work. README shows correct usage (and tests do as well).

@DxCx DxCx added the ready label Jan 24, 2017
@DxCx
Copy link
Contributor

DxCx commented Jan 24, 2017

@helfer please merge #274 which should fix the travis issues,
then merge this upon this should give you a branch that passes tests.

@helfer
Copy link
Contributor

helfer commented Jan 24, 2017

Thanks @joelgriffith for fixing it up, and thanks @DxCx for fixing the travis issues. You guys are awesome!

@helfer helfer merged commit a29d8b6 into apollographql:master Jan 24, 2017
@helfer helfer removed the ready label Jan 24, 2017
@jadkap
Copy link
Contributor

jadkap commented Jan 27, 2017

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants