Skip to content

Conversation

@Tobbe
Copy link
Member

@Tobbe Tobbe commented Aug 11, 2025

Pulling these changes over from #80. It seems it doesn't really matter for the tests that use these fixtures how gql is imported, but now at least they match what it will soon look like in all new Cedar apps

@netlify
Copy link

netlify bot commented Aug 11, 2025

Deploy Preview for cedarjs canceled.

Name Link
🔨 Latest commit be788a3
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/689a185a21ffc9000883e8b1

@Tobbe Tobbe changed the title feat(esm): packages/internal: Update test fixtures to use ESM style g… feat(esm): packages/internal: Update test fixtures to use ESM style gql imports Aug 11, 2025
@Tobbe Tobbe added this to the next-release milestone Aug 11, 2025
@Tobbe Tobbe marked this pull request as ready for review August 11, 2025 16:22
@Tobbe Tobbe enabled auto-merge (squash) August 11, 2025 16:22
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR updates GraphQL tag imports in test fixture files from CommonJS-style default imports (import gql from 'graphql-tag') to ESM-style named imports (import { gql } from 'graphql-tag'). The changes affect four test fixture files in the packages/internal package that are used for GraphQL code generation testing.

The modification is part of Cedar's broader migration to ESM (ECMAScript Modules) support. The graphql-tag package requires named imports when running in ESM environments due to how modern module resolution works with TypeScript and bundlers. While these changes don't affect the actual test behavior (as noted in the PR description), they ensure that the test fixtures match the import patterns that will be used in newly generated Cedar applications.

The affected files are all located in packages/internal/src/__tests__/fixtures/graphqlCodeGen/ and specifically target the requireAuth and skipAuth directive files in both the bookshelf and realtime test fixture directories. These fixtures are used by the internal package's testing infrastructure to validate GraphQL code generation functionality.

This change prepares the codebase for the upcoming ESM transition by ensuring consistency between test fixtures and the actual code patterns that will be generated for users, maintaining alignment with the framework's modernization efforts.

Confidence score: 5/5

  • This PR is extremely safe to merge with no risk of breaking functionality
  • Score reflects simple import syntax changes with no logic modifications and clear ESM migration purpose
  • No files require special attention as all changes are identical import statement updates

4 files reviewed, no comments

Edit Code Review Bot Settings | Greptile

@Tobbe Tobbe merged commit 5be03c8 into main Aug 11, 2025
64 of 67 checks passed
@Tobbe Tobbe deleted the tobbe-internal-test-graphql-tag branch August 11, 2025 16:52
Tobbe added a commit that referenced this pull request Aug 22, 2025
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