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

Add an improved graphqlOperationLoggingPlugin, deprecate the old loggingPlugin #141

Merged
merged 7 commits into from
Oct 16, 2023

Conversation

cuzzlor
Copy link
Collaborator

@cuzzlor cuzzlor commented Oct 12, 2023

What ?

Add new improved GraphQL operation logging plugin.

Why ?

Over in another project we added audit logging output via logger.audit(...)

We wanted to audit every GraphQL operation with features not offered by the current loggingPlugin, so we added the following features:

  • allow us to use logger.audit, not logger.info
  • allow us to strip sensitive info from logged variables
  • allow us to log output data for mutations (this allows audit entries to show exactly what was created / mutated from GraphQL mutation intput)
  • allow us to easily ignore introspection queries without writing an ignore callback (breaking change)
  • loggingPlugin shouldIgnore callback had a strange signature not matching the data received by apollo plugins (breaking change)
  • add the operation type into output

Why not modify the existing logging plugin?

Since there are two breaking changes along with a heap of new functionality, I feel it's best to keep the existing plugin intact but deprecate it rather than replacing it with breaking changes.

@cuzzlor cuzzlor merged commit 3c5c7cb into main Oct 16, 2023
1 check passed
@cuzzlor cuzzlor deleted the improve-logging-plugin branch October 16, 2023 02:17
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

Successfully merging this pull request may close these issues.

2 participants