Graphql: support fastify

Created on 14 Feb 2019  路  19Comments  路  Source: nestjs/graphql

I'm submitting a...


[ ] Regression 
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

image

I want to use fastify .

Expected behavior

@nestjs/graphql no longer relies on apollo-graphql-express.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

we need express or fastify.

Environment


Nest version: 5.6.0


For Tooling issues:
- Node version: XX  
- Platform:  

Others:

todo feature

Most helpful comment

Supported in 6.4.0

All 19 comments

@kamilmysliwiec any ideas how to do this? If you can somehow point me in the right direction I could create an initial PR ;)

@kamilmysliwiec any ideas how to do this? If you can somehow point me in the right direction I could create an initial PR ;)

Create a new github repository.
Do a nest-graphql-fastify first?

@zuohuadong will do ;)

You can conditionally use a different package depending on the HttpAdapter (no requirement to create a separate repo).

@kamilmysliwiec that鈥檚 what I thought too, but should I require both nest en fastify platform into the package.json.

And how do I conditionally import the Apollo modules in typescript?

should I require both nest en fastify platform into the package.json.

Both platform packages should be moved to optional dependencies and loaded conditionally through require()

@kamilmysliwiec I get that but what about the GqlModuleOptions should I create two? One for fastify and one for express and how do I keep the strong typing in that?

@ToonvanStrijp
Do you have any progress?

@zuohuadong nope not yet, sorry for the delay. I was looking at it but I can't figure it out to include the types correctly depending on what base package you have (fastify/express). If you're using express you have different GqlModuleOptions then in fastify so I'm looking for a way to require the right options depending on what framework you're using and still have strict typing.

Hi all,

who can suggest how to replace apollo-server-express with apollo-server-fastify in v6?

@ogheo I've some time free today so I'll make a start on this.

@zuohuadong @ogheo I've implemented fastify support in my pull request, any feedback is welcome.

@zuohuadong @ogheo I've implemented fastify support in my pull request, any feedback is welcome.

thanks

Any update? Is it ready to merge?

@alex-shamshurin yup it is now.

Supported in 6.4.0

@kamilmysliwiec the nestjs cli add by default the version 6.0.0, also, this functionality is not added in the docs :(

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings