Skip to content

feat(gql): Trusted Documents support for CedarJS Mailer #263

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

Merged
merged 3 commits into from
Jul 21, 2025

Conversation

ladderschool
Copy link
Contributor

@ladderschool ladderschool commented Jul 20, 2025

Studio is broken for the mail feature if trusted documents store is enabled. See redwoodjs/studio#75

This fixes the issue:

Not Working
This was the first initialization of studio with a test project, as you can see the second example is not showing and there's a copy remnant there. With trusted documents it's not synchronizing effectively.

Fixed
This shows that studio synchronizes effectively after the changes in this PR.

EDIT by Tobbe:
I wanted to surface this really informative code comment:

/**
 * When using Studio, we want to allow the `resyncMailRenderers` and
 * `resyncMailTemplate` mutations to be executed without a persisted operation.
 * This is only allowed in local development, ensure you have
 * NODE_ENV=development set.
 *
 * This is because the `resyncMailRenderers` mutation is a special case that is
 * used by Studio to sync mail renderers from the mailer configuration.
 *
 * This function checks if the request is for the `resyncMailRenderers` or
 * `resyncMailTemplate` mutations and has the correct headers.
 *
 * If you need Studio in production, you just have to add the above mutations to
 * your SDL schema and as dummy resolvers so Trusted Documents can pick them up.
 */

Copy link

netlify bot commented Jul 20, 2025

Deploy Preview for cedarjs failed. Why did it fail? →

Name Link
🔨 Latest commit f5049eb
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/687df3615f9d8c00083c8352

@Tobbe Tobbe added the changesets-ok Override the changesets check label Jul 21, 2025
@Tobbe Tobbe added this to the next-release milestone Jul 21, 2025
@Tobbe Tobbe changed the title Mail Templates/Renders sync correctly with Trusted Documents fix(gql): Mail Templates/Renders sync correctly with Trusted Documents Jul 21, 2025
@Tobbe Tobbe changed the title fix(gql): Mail Templates/Renders sync correctly with Trusted Documents feat(gql): Trusted Documents support for Cedar Mailer Jul 21, 2025
@Tobbe Tobbe changed the title feat(gql): Trusted Documents support for Cedar Mailer feat(gql): Trusted Documents support for CedarJS Mailer Jul 21, 2025
@Tobbe Tobbe added the release:feature This PR introduces a new feature label Jul 21, 2025
@Tobbe Tobbe merged commit 2f04033 into cedarjs:main Jul 21, 2025
54 of 65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changesets-ok Override the changesets check release:feature This PR introduces a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants