-
Notifications
You must be signed in to change notification settings - Fork 186
Description
Issue summary
GraphQL Types generated by Shopify's codegen preset @shopify/api-codegen-preset in admin.generated.d.ts have an incorrect import for the admin types from @shopify/admin-api-client
Before opening this issue, I have:
- Upgraded to the latest version of the relevant packages
@shopify/*package and version: @shopify/[email protected], @shopify/[email protected], @shopify/[email protected], @shopify/[email protected]- Node version: 20.19.0
- Operating system: Win 11
- Set
{ logger: { level: LogSeverity.Debug } }in my configuration, when applicable - Found a reliable way to reproduce the problem that indicates it's a problem with the package
- Tested a project from scratch with the typescript, the @shopify/admin-api-client and @shopify/api-codegen-preset
- Looked for similar issues in this repository
- A similar issue was reported here last year
- Checked that this isn't an issue with a Shopify API
- If it is, please create a post in the Shopify community forums or report it to Shopify Partner Support
Using the @shopify/admin-api-client with Shopify's codegen @shopify/api-codegen-preset. The GraphQL types generated by codegen in admin.generated.d.ts have this typescript error.
The path to ./admin.types is invalid because the default output for the admin types is admin.types.d.ts. This prevents you from building the typescript project
The .graphqlrc.ts is configured following the basic template outlined here:
import {ApiType, shopifyApiProject} from '@shopify/api-codegen-preset';
export default {
schema: 'https://shopify.dev/admin-graphql-direct-proxy/2025-10',
documents: ['./src/*.ts', '!node_modules'],
projects: {
default: shopifyApiProject({
apiType: ApiType.Admin,
apiVersion: '2025-10',
outputDir: './src/types',
}),
},
};
I can change it manually to ./admin.types.js but this would have to be done every time codegen compiles the types
Expected behavior
Generated files from Shopify api packages should be compatible with each other out of the box
Actual behavior
There is a typescript error in the import
Steps to reproduce the problem
- Template a new typescript project with the @shopify/shopify-api @shopify/admin-api-client and @shopify/api-codegen-preset packages
- Create a
.graphqlrc.tsconfiguration - Create a graphql query in the project that will be compiled by codegen
- Run graphql-codegen
- Open the
admin.generated.d.tsfile to verify the error or run "tsc" to compile typescript and verify the error