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

NEBULA-2161: send package version to embeds #7430

Conversation

mayakoneval
Copy link
Contributor

@mayakoneval mayakoneval commented Mar 8, 2023

This pr should be rebased off of #7432

Context

JIRA
Slack

What Changed?

This PR does 2 things

  1. passes the packageVersion as query params in the <script tag that requests the embedded Explorer / Sandbox CDN bundle.
  2. sends the packageVersion to the embedded Explorer & Sandbox, which are set up to send these as query params to Studio. This is redundant data capture just in case.

How to test

erm, run the landing pages locally, check the console & see that the version shows up correctly in the cdn script url

there are already tests for the html functions

@netlify
Copy link

netlify bot commented Mar 8, 2023

Deploy Preview for apollo-server-docs ready!

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/sites/apollo-server-docs/deploys/640a47c1c888210f959a77a6
😎 Deploy Preview https://deploy-preview-7430--apollo-server-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 8, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@mayakoneval mayakoneval force-pushed the maya/03-2023/NBLA-2161/send-as-version-to-embeds branch 2 times, most recently from 9866c38 to 5eec097 Compare March 8, 2023 19:53
Copy link
Member

@trevor-scheer trevor-scheer left a comment

Choose a reason for hiding this comment

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

Just one question, otherwise lgtm! Can you add a changeset please?

packages/server/src/plugin/landingPage/default/index.ts Outdated Show resolved Hide resolved
@mayakoneval
Copy link
Contributor Author

@trevor-scheer I don't think this is changeset worthy, its not a user facing change at all / no behavior change at all?

@mayakoneval mayakoneval force-pushed the maya/03-2023/NBLA-2161/send-as-version-to-embeds branch 4 times, most recently from 92dcf5f to ec62169 Compare March 9, 2023 06:40
@mayakoneval mayakoneval force-pushed the maya/03-2023/NBLA-2161/send-as-version-to-embeds branch 2 times, most recently from cdefde2 to a99836f Compare March 9, 2023 18:41
@mayakoneval mayakoneval force-pushed the maya/03-2023/NBLA-2161/send-as-version-to-embeds branch from 614e138 to 98986ce Compare March 9, 2023 20:32
@mayakoneval mayakoneval force-pushed the maya/03-2023/NBLA-2161/send-as-version-to-embeds branch from 621557b to b2cb19d Compare March 9, 2023 20:42
@trevor-scheer trevor-scheer merged commit b694bb1 into apollographql:main Mar 9, 2023
@github-actions github-actions bot mentioned this pull request Mar 9, 2023
trevor-scheer pushed a commit that referenced this pull request Mar 10, 2023
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @apollo/server@4.5.0

### Minor Changes

- [#7431](#7431)
[`7cc163ac8`](7cc163a)
Thanks [@mayakoneval](https://github.com/mayakoneval)! - In the Apollo
Server Landing Page Local config, you can now automatically turn off
autopolling on your endpoints as well as pass headers used to introspect
your schema, embed an operation from a collection, and configure whether
the endpoint input box is editable. In the Apollo Server Landing Page
Prod config, you can embed an operation from a collection & we fixed a
bug introduced in release 4.4.0

    Example of all new config options:

    ```
    const server = new ApolloServer({
      typeDefs,
      resolvers,
      plugins: [
        process.env.NODE_ENV === 'production'
          ? ApolloServerPluginLandingPageProductionDefault({
              graphRef: 'my-graph-id@my-graph-variant',
              collectionId: 'abcdef',
              operationId: '12345'
              embed: true,
              footer: false,
            })
          : ApolloServerPluginLandingPageLocalDefault({
              collectionId: 'abcdef',
              operationId: '12345'
              embed: {
                initialState: {
                  pollForSchemaUpdates: false,
                  sharedHeaders: {
"HeaderNeededForIntrospection": "ValueForIntrospection"
                  },
                },
                endpointIsEditable: true,
              },
              footer: false,
            }),
      ],
    });

    ```

- [#7430](#7430)
[`b694bb1dd`](b694bb1)
Thanks [@mayakoneval](https://github.com/mayakoneval)! - We now send
your @apollo/server version to the embedded Explorer & Sandbox used in
the landing pages for analytics.

### Patch Changes

- [#7432](#7432)
[`8cbc61406`](8cbc614)
Thanks [@mayakoneval](https://github.com/mayakoneval)! - Bug fix: TL;DR
revert a previous change that stops passing includeCookies from the prod
landing page config.

    Who was affected?

Any Apollo Server instance that passes a `graphRef` to a production
landing page with a non-default `includeCookies` value that does not
match the `Include cookies` setting on your registered variant on
studio.apollographql.com.

    How were they affected?

From release 4.4.0 to this patch release, folks affected would have seen
their Explorer requests being sent with cookies included only if they
had set `Include cookies` on their variant. Cookies would not have been
included by default.

## @apollo/server-integration-testsuite@4.5.0

### Patch Changes

- Updated dependencies
\[[`7cc163ac8`](7cc163a),
[`8cbc61406`](8cbc614),
[`b694bb1dd`](b694bb1)]:
    -   @apollo/server@4.5.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 19, 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.

None yet

2 participants