Exported schemas in .ts files are not generated
See original GitHub issueIssue Description
Hi, trying to migrate from 0.2.0 to 1.1.2 but it doesn’t seem my type for an exported query schema gets exported anymore (file is in src/lib/ folder). Under 0.2.0 the following query:
export const schema = graphql`
query Posts {
allMdx(sort: { order: DESC, fields: [frontmatter___date] }) {
edges {
node {
id
excerpt(pruneLength: 250)
frontmatter {
title
slug
categories
tags
}
body
}
}
}
}
`
would result in the following schema generation
export type PostsQuery = (
{ __typename?: 'Query' }
& { allMdx: (
{ __typename?: 'MdxConnection' }
& { edges: Array<(
{ __typename?: 'MdxEdge' }
& { node: (
{ __typename?: 'Mdx' }
& Pick<Mdx, 'id' | 'excerpt' | 'body'>
& { frontmatter: Maybe<(
{ __typename?: 'MdxFrontmatter' }
& Pick<MdxFrontmatter, 'title' | 'slug' | 'categories' | 'tags'>
)> }
) }
)> }
) }
);
What I am doing wrong here, are there breaking changes?
Issue Analytics
- State:
- Created 3 years ago
- Comments:18 (12 by maintainers)
Top Results From Across the Web
codegen.ts file - GraphQL Code Generator
GraphQL Code Generator relies on a configuration file named codegen.ts to manage all possible options, input, and output document types.
Read more >typescript-json-schema - npm
Generate json-schemas from your Typescript sources. Features. Compiles your Typescript program to get complete type information. Translates ...
Read more >TypeScript Type Safety with AJV Standalone
It can not know that the JSON object being casted to Type A actually ... Generate the JSON Schema files from the TS...
Read more >Generating the client (Concepts) - Prisma
prisma/client folder, which is the default location for the unique Prisma Client generated from your schema. @prisma/client/index.d.ts exports .prisma/client :.
Read more >db2move - Database movement tool command - IBM
The default for the EXPORT action is all schemas. The default does not apply to the COPY action. If you specify multiple schema...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey folks, I just wanted to mention that I resolved my " Cannot find namespace ‘GatsbyTypes’." problem by adding
to my
gatsby-config.ts
.I hope it helps somebody who lands here googling this error like I did today 😊
I’ll create a repo that reproduces the issue tomorrow 👍