Skip to content

Bump codegen packages - #8346

Merged
eddeee888 merged 12 commits into
mainfrom
bump-codegen-packages
Aug 14, 2026
Merged

Bump codegen packages#8346
eddeee888 merged 12 commits into
mainfrom
bump-codegen-packages

Conversation

@eddeee888

@eddeee888 eddeee888 commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Background

This PR:

  • bumps codegen packages to latest versions
  • update related config
  • update type referencing
  • update @graphql-codegen/schema-ast patch

Comment thread pnpm-workspace.yaml Outdated
Comment thread codegen.mts
flattenGeneratedTypes: true,
onlyOperationTypes: true,
},
plugins: ['typescript', 'typescript-operations'],

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

onlyOperationTypes is used by typescript plugin, but in the latest major version typescript-operations works by itself, so both the plugin and option can be removed

Comment thread codegen.mts
};

module.exports = config;
export default config;

@eddeee888 eddeee888 Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Looks like this file had .cjs extension before, so we needed module.exports. This PR changes both eslint config target and this export line to avoid errors being reported to IDE

@@ -1,5 +1,4 @@
import { Inject, Injectable, Scope } from 'graphql-modules';
import { OrganizationReferenceInput } from 'packages/libraries/core/src/client/__generated__/types';

@eddeee888 eddeee888 Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Other declarations in this file seem to use the local GraphQLSchema.OrganizationReferenceInput instead of the one from the client library. This helps with consistency and avoid cross-imports.

The client library also just generates used schema types for itself, in the latest version, so we can't depend on types from that library anymore.

There are a few other similar replacement in this PR.

Comment thread codegen.mts
Comment on lines +70 to +72
ID: 'string',
DateTime64: 'string',
JSONObject: 'Record<string,unknown>',

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Previously, unknown scalars are generated as any.
Now, they are generated as unknown by default, so we need to add these to avoid type errors.

We could use any to achieve the same behaviour, but I think explicit types give better/safer DX

@eddeee888 eddeee888 Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Actually JSONObject could be any so we don't have to do these as ... in our code like this

Do we have preferences? 🤔

Comment thread codegen.mts
documents: ['./packages/web/app/src/(components|lib|pages|server)/**/*.ts(x)?'],
preset: 'client',
config: {
enumType: 'native',

@eddeee888 eddeee888 Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Previously, native enums are generated by default.
In the latest major version, string-literal is the default.

We have already used native enums in some places so we need to ensure native enum is generated

minimap: { enabled: false },
}}
code={span.spanAttributes['graphql.document']}
code={span.spanAttributes['graphql.document'] as string}

@eddeee888 eddeee888 Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think span.spanAttributes['graphql.document'] could be string | undefined?
But we didn't do || '' here. Unless the server always guarantees the attribute is always there? 🤔

} else if (result.schemaPublish.__typename === 'SchemaPublishMissingServiceError') {
throw new SchemaPublishMissingServiceError(result.schemaPublish.missingServiceError);
throw new SchemaPublishMissingServiceError(
result.schemaPublish.missingServiceError || 'Unknown schemaPublish.missingServiceError',

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

missingServiceError (and others below) could be undefined because of the conditional directive being applied on the fragment.

This change is needed because the previous type was not considering the conditional directives. Fixed here

@eddeee888
eddeee888 force-pushed the bump-codegen-packages branch from 9419297 to cda6300 Compare August 12, 2026 12:07
return t.state.value;
};

export const renderWarnings = (warnings: SchemaWarningConnection) => {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

SchemaWarningConnection is the full schema type but we only need a subset of it for this function to work.
I think inlining is fine, as this looks like a utility function, and it only needs a certain interface (which is a subset of the full schema SchemaWarningConnection) to work.

@theguild-bot

theguild-bot commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@graphql-hive/laboratory 0.2.5-alpha-20260813103813-f3bc7ec5f0e885b43fec646b50af25f0fae29be9 npm ↗︎ unpkg ↗︎
@graphql-hive/render-laboratory 0.1.16-alpha-20260813103813-f3bc7ec5f0e885b43fec646b50af25f0fae29be9 npm ↗︎ unpkg ↗︎
hive 11.11.1-alpha-20260813103813-f3bc7ec5f0e885b43fec646b50af25f0fae29be9 npm ↗︎ unpkg ↗︎

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🐋 This PR was built and pushed to the following Docker images:

Targets: build

Platforms: linux/arm64

Image Tags: 11.11.1-alpha-2ef40ee, 2ef40ee, 2ef40eec5da6568b7a9d2e4a2fedfc06634ea464

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Previous patch stopped working because of minor differences in the file and hash.
This should apply the same patch to the current version.

@eddeee888
eddeee888 force-pushed the bump-codegen-packages branch from f3bc7ec to 730b3dc Compare August 13, 2026 10:45
@eddeee888
eddeee888 requested review from jdolle and n1ru4l August 13, 2026 12:32
@eddeee888
eddeee888 marked this pull request as ready for review August 13, 2026 12:32
@eddeee888
eddeee888 merged commit 8fd4324 into main Aug 14, 2026
29 checks passed
@eddeee888
eddeee888 deleted the bump-codegen-packages branch August 14, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants