Bump codegen packages - #8346
Conversation
| flattenGeneratedTypes: true, | ||
| onlyOperationTypes: true, | ||
| }, | ||
| plugins: ['typescript', 'typescript-operations'], |
There was a problem hiding this comment.
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
| }; | ||
|
|
||
| module.exports = config; | ||
| export default config; |
There was a problem hiding this comment.
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'; | |||
There was a problem hiding this comment.
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.
| ID: 'string', | ||
| DateTime64: 'string', | ||
| JSONObject: 'Record<string,unknown>', |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Actually JSONObject could be any so we don't have to do these as ... in our code like this
Do we have preferences? 🤔
| documents: ['./packages/web/app/src/(components|lib|pages|server)/**/*.ts(x)?'], | ||
| preset: 'client', | ||
| config: { | ||
| enumType: 'native', |
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
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? 🤔
4d598f5 to
f96af50
Compare
| } else if (result.schemaPublish.__typename === 'SchemaPublishMissingServiceError') { | ||
| throw new SchemaPublishMissingServiceError(result.schemaPublish.missingServiceError); | ||
| throw new SchemaPublishMissingServiceError( | ||
| result.schemaPublish.missingServiceError || 'Unknown schemaPublish.missingServiceError', |
There was a problem hiding this comment.
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
9419297 to
cda6300
Compare
| return t.state.value; | ||
| }; | ||
|
|
||
| export const renderWarnings = (warnings: SchemaWarningConnection) => { |
There was a problem hiding this comment.
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.
🚀 Snapshot Release (
|
| 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 ↗︎ |
|
🐋 This PR was built and pushed to the following Docker images: Targets: Platforms: Image Tags: |
There was a problem hiding this comment.
Previous patch stopped working because of minor differences in the file and hash.
This should apply the same patch to the current version.
f3bc7ec to
730b3dc
Compare
Background
This PR:
@graphql-codegen/schema-astpatch