Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Using global declaration with namespace instead of using module (#47)
Changed generated types to the global declaration as default, so it can be used without manual imports. And use a namespace(default is `GatsbyTypes`) to avoid type conflicts with other global declarations. It doesn't allow undefined or empty string, after the upgrade, every typenames in user codebase will be changed by the namespace. ```tsx import type { SEOQuery } from '~/src/__generated__/gatsby-types'; function SEO() { const data = useStaticQuery<SEOQuery>( graphql` query SEO { ... } ` ); ... ``` will be changed into: ```tsx // no need to import the type function SEO() { const data = useStaticQuery<GatsbyTypes.SEOQuery>( graphql` query SEO { ... } ` ); ... ``` Since the Flow doesn't have namespace syntax, It uses `$` as the fallback behavior. Closes #24 Closes #16
- Loading branch information
Showing
6 changed files
with
95 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters