Describe the bug
Cannot generate types when the repo/directory name contains a "." (period) character.
To Reproduce
cd test2.0 && yarn installyarn generate # This "Book" type defines the queryable fields for every book in our data source.
type Book {
title: String
author: String
}
# The "Query" type is special: it lists all of the available queries that
# clients can execute, along with the return type for each. In this
# case, the "books" query returns an array of zero or more Books (defined above).
type Query {
books: [Book]
}
query GetBooks {
books {
title
author
}
}
codegen.yml config file:overwrite: true
schema: "server/index.js"
documents: "src/**/*.{ts,tsx}"
generates:
src/generated/types.ts:
plugins:
- "typescript"
- "typescript-operations"
- "typescript-react-apollo"
Expected behavior
Types generated without issue
Environment:
@graphql-codegen/...: 1.17.10Additional context
After digging into some of the cli code, I am certain the trouble generating types has to do with the directory name: test2.0 in my case. My company has a repo with 2.0 in the directory name. After changing the name to test2, the types generate without errors.
See makeDefaultLoader() in the cli/bin.js code.
Yes, it's all about dots in the path. There is already a PR done #4860 by @adambrgmn. Let's hope the new release will be out soon.
@macgyver2k sorry for the delay. Will release today :)
Fixed in @graphql-codegen/[email protected]
Most helpful comment
@macgyver2k sorry for the delay. Will release today :)