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

useGlobalPrefix not working for Apollo Gateway module #1158

Closed
ldiego08 opened this issue Sep 16, 2020 · 2 comments
Closed

useGlobalPrefix not working for Apollo Gateway module #1158

ldiego08 opened this issue Sep 16, 2020 · 2 comments

Comments

@ldiego08
Copy link

I'm submitting a...


[ ] Regression 
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request

Current behavior

A global prefix has been set at the app level, but it won't work with the Apollo Gateway module. Accessing ../api/graphql results in a 404 but ../graphql works.

Expected behavior

Since the global prefix has been set to /api, the GraphQL endpoint should be accessible at ../api/graphql

Minimal reproduction of the problem with instructions

I'm using the following app module code:

using the following code in the app module:

@Module({
    imports: [
        GraphQLGatewayModule.forRootAsync({
            useFactory: () => ({
                server: {
                    cors: true,
                    useGlobalPrefix: true, // .. set as '/api' in main.ts
                    path: '/graphql',
                },
                gateway: {
                    serviceList: /* .. my services */,
                },
            }),
        }),
    ],
})
export class AppModule {}

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

Environment


Nest version: 7.4.2

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

Others:

@kamilmysliwiec
Copy link
Member

Would you like to create a PR for this issue?

@kamilmysliwiec
Copy link
Member

Fixed in this commit 2465370. This will be a part of the next release.

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

No branches or pull requests

2 participants