graphql icon indicating copy to clipboard operation
graphql copied to clipboard

fix(deps): remove apollo-server-plugin-landing-page-graphql-playground

Open elijaholmos opened this issue 2 years ago • 6 comments

PR Checklist

Please check if your PR fulfills the following requirements:

  • [x] The commit message follows our guidelines: https://github.com/nestjs/nest/blob/master/CONTRIBUTING.md
  • [ ] Tests for the changes have been added (for bug fixes / features)
  • [ ] Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • [x] Bugfix
  • [ ] Feature
  • [ ] Code style update (formatting, local variables)
  • [ ] Refactoring (no functional changes, no api changes)
  • [ ] Build related changes
  • [ ] CI related changes
  • [ ] Other... Please describe:

What is the current behavior?

Issue Number: #2972

What is the new behavior?

Removes the deprecated dependency @apollo/server-plugin-landing-page-graphql-playground, described in #2972. Follows the official guide published by the Apollo team at https://www.apollographql.com/docs/apollo-server/api/plugin/landing-pages/#configuring-default-landing-pages to migrate to the new replacement.

Does this PR introduce a breaking change?

  • [ ] Yes
  • [x] No

elijaholmos avatar Aug 18 '23 22:08 elijaholmos

@elijaholmos How can I support that this MR is accepted and merged? We also see this warning regularly and would like to fix it.

twestendorff avatar Sep 10 '24 06:09 twestendorff

@twestendorff, sorry, I am not a maintainer of this repository, only a first-time contributor. One of the team members would need to approve & merge this PR. Sadly, it has been over a year without any activity, so I am not optimistic

elijaholmos avatar Sep 10 '24 16:09 elijaholmos

Coming here after doing some JS type trickery to make @nestjs/apollo use the embedded studio landing page plugin. The Playground plugin has been EOL since 2022 and while I'm not super happy about all the upsells in the embedded studio page it's actually a really good experience for local dev.

Can confirm it works as a drop-in replacements to playground

cbnsndwch avatar Sep 10 '24 23:09 cbnsndwch

Here's my current workaround, in case this doesn't get merged:

import { ConfigService } from '@nestjs/config';
import { GraphQLModule } from '@nestjs/graphql';

import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo';
import { ApolloServerPluginLandingPageLocalDefault } from '@apollo/server/plugin/landingPage/default';

import { configModule } from '../config';

export const graphqlModule = GraphQLModule.forRootAsync<ApolloDriverConfig>({
    driver: ApolloDriver,
    imports: [configModule],
    inject: [ConfigService],
    async useFactory(configService: ConfigService) {
        const { APP_ENV } = configService.get<any>('app');

        const isDev = APP_ENV === 'dev';

        const plugins = [];
        if (isDev) {
            plugins.push(
                ApolloServerPluginLandingPageLocalDefault({
                    footer: false,
                    embed: true
                })
            );
        }

        return {
            playground: 0 as any, // <- this
            plugins
            // ... other options here
        } satisfies ApolloDriverConfig;
    }
});

cbnsndwch avatar Sep 10 '24 23:09 cbnsndwch

@elijaholmos I saw that but still wanted to offer my help, maybe there is an issue that I don't know why this MR is not accepted/merged.

It's a sad that it's been open for so long. 2022 is already some time ago.

@kamilmysliwiec can you as a maintainer help here?

twestendorff avatar Sep 16 '24 10:09 twestendorff

If someone wants to use Apollo Studio instead, they can register a dedicated plugin. We remain using GrapQL Playground as the default to avoid introducing unnecessary breaking changes - there's really no rush in migrating to the different version (no security issues whatsoever that would force us to do so too)

kamilmysliwiec avatar Sep 16 '24 10:09 kamilmysliwiec