Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: make contextType independent of source types
BREAKING CHANGES: - `contextType` is no longer nested in `typegenAutoConfig` - `contextType` can no longer references `sources` registered in `typegenAutoConfig` - `contextType` API was refactored to use `module` instead of `path` and `export` instead of `name` - `rootTyping` API was refactored to use `module` instead of `path` and `export` instead of `name`
- Loading branch information
Showing
30 changed files
with
274 additions
and
134 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { LaunchApi, UserApi } from './typeDefs' | ||
|
||
export interface Context { | ||
dataSources: { | ||
userAPI: UserApi | ||
launchAPI: LaunchApi | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,24 @@ | ||
import { NexusGenEnums } from "../star-wars-typegen"; | ||
import { NexusGenEnums } from '../star-wars-typegen' | ||
|
||
/** | ||
* These are Flow types which correspond to the schema. | ||
* They represent the shape of the data visited during field resolution. | ||
* These are Flow types which correspond to the schema. They represent the shape of the data visited during | ||
* field resolution. | ||
*/ | ||
export interface CharacterFields { | ||
id: string; | ||
name: string; | ||
friends: string[]; | ||
appears_in: NexusGenEnums["Episode"][]; | ||
id: string | ||
name: string | ||
friends: string[] | ||
appears_in: NexusGenEnums['Episode'][] | ||
} | ||
|
||
export interface Human extends CharacterFields { | ||
type: "Human"; | ||
home_planet?: string; | ||
type: 'Human' | ||
home_planet?: string | ||
} | ||
|
||
export interface Droid extends CharacterFields { | ||
type: "Droid"; | ||
primary_function: string; | ||
type: 'Droid' | ||
primary_function: string | ||
} | ||
|
||
export type Character = Human | Droid; | ||
|
||
export interface ContextType {} | ||
export type Character = Human | Droid |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export interface ContextType {} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import * as ts from 'typescript' | ||
|
||
export interface ContextType { | ||
source: ts.SourceFile | ||
} |
Oops, something went wrong.