-
Notifications
You must be signed in to change notification settings - Fork 130
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
near-operation-file + typescript-react-apollo = Failed to resolve .js import #218
Comments
1 task
Hi @tpinne, Could you update all your |
Hi @charlypoly, I updated all packages but it made no difference. Still get generated files with Still output like this: /* eslint-disable */
import * as Types from '../types.generated.js';
import { DocumentNode } from 'graphql';
import { ReadAchievementFragmentDoc } from '../Fragments/ReadAchievement.generated.js';
import { BookFragmentDoc } from '../Fragments/BookFragment.generated.js';
import { LevelAchievementFragmentDoc } from '../Fragments/LevelAchievementFragment.generated.js';
import { LevelFragmentDoc } from '../Fragments/Level.generated.js';
import * as Apollo from '@apollo/client';
export type DummyTypeExport = Types.Exact<{ [key: string]: never }>;
// .... |
I can confirm that this is still happening @charlypoly, and that I have the latest versions: import { CodegenConfig } from '@graphql-codegen/cli';
const config: CodegenConfig = {
overwrite: true,
schema: 'http://localhost:4201/graphql',
documents: ['src/**/!(*.d|*.generated).{ts,tsx}'],
config: {
maybeValue: 'T | null | undefined',
scalars: {
DateTime: 'Date',
},
},
generates: {
'src/globalTypes/index.ts': {
plugins: ['typescript'],
config: {
onlyOperationTypes: true,
skipTypename: true,
},
},
'src/': {
preset: 'near-operation-file',
presetConfig: {
baseTypesPath: 'globalTypes',
},
plugins: ['typescript-operations', 'typescript-react-apollo'],
config: {
withHooks: true,
withMutationFn: true,
documentMode: 'external',
importDocumentNodeExternallyFrom: 'near-operation-file',
inlineFragmentTypes: 'combine',
skipTypename: true,
emitLegacyCommonJSImports: false,
},
},
},
hooks: {
beforeDone: ['prettier --write **/*.generated.ts', 'eslint --fix **/*.generated.ts --cache'],
},
};
export default config; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I still have the same issues as in dotansimha/graphql-code-generator#8065 even with
emitLegacyCommonJSImports: false
.Your Example Website or App
Currently I have no simple repo to provide. If you can't get anywhere without let me know. I try to find time to provide a stripped down repo.
Steps to Reproduce the Bug or Issue
Expected behavior
There should be no .js in the fragment filename.
Screenshots or Videos
No response
Platform
graphql
version: 16.6.0@graphql-codegen/*
version(s):Codegen Config File
Additional context
No response
The text was updated successfully, but these errors were encountered: