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

Grafserv overhaul: now compatible with envelop #2046

Merged
merged 30 commits into from
May 6, 2024
Merged

Conversation

benjie
Copy link
Member

@benjie benjie commented May 3, 2024

Description

Wanted to add support for @graphile/depth-limit validation rule; and in doing so had to refactor stuff... and had meant to add support for envelop for a while... so did that too.

import { envelop, useLogger, useMaskedErrors } from "@envelop/core";
import { GrafservEnvelopPreset } from "grafserv/envelop";

const getEnveloped = envelop({
  plugins: [
    useLogger({
      logFn(eventName, args) {
        console.log(eventName, args);
      },
    }),
    useMaskedErrors(),
  ],
});

const preset = {
  extends: [GrafservEnvelopPreset],
  grafserv: {
    getEnveloped,
  },
};

Performance impact

If you don't enable the envelop support, impact should be minimal. If you enable envelop support then 🤷‍♂️

Security impact

None unless you opt in to using envelop, in which case you open yourself to a whole other plugin ecosystem.

Checklist

  • My code matches the project's code style and yarn lint:fix passes.
  • I've added tests for the new feature, and yarn test passes.
  • I have detailed the new feature in the relevant documentation.
  • I have added this feature to 'Pending' in the RELEASE_NOTES.md file (if one exists).
  • If this is a breaking change I've explained why.

Copy link

changeset-bot bot commented May 3, 2024

🦋 Changeset detected

Latest commit: e73f072

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 15 packages
Name Type
grafast Patch
grafserv Patch
postgraphile Patch
@localrepo/grafast-bench Patch
@dataplan/json Patch
@dataplan/pg Patch
@grafserv/persisted Patch
ruru-components Patch
@localrepo/grafast-website Patch
graphile-build-pg Patch
graphile-build Patch
graphile-utils Patch
pgl Patch
graphile-export Patch
graphile Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@benjie benjie merged commit c106e44 into main May 6, 2024
24 checks passed
@benjie benjie deleted the grafserv-plugins branch May 6, 2024 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

1 participant