-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(gatsby): graphql engine (#33030)
* feat: graphql engine * lint * generate schema snapshot for v4 only * fix stack-trace utils * prevent schema snapshotting in workers * address engine PR review comments * revert require.resolve
- Loading branch information
Showing
28 changed files
with
857 additions
and
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// IGatsbyPage, SystemPath and copied/inlined from redux/types so this file is self contained | ||
type SystemPath = string | ||
type Identifier = string | ||
|
||
export interface IGatsbyPage { | ||
internalComponentName: string | ||
path: string | ||
matchPath: undefined | string | ||
component: SystemPath | ||
componentChunkName: string | ||
isCreatedByStatefulCreatePages: boolean | ||
context: Record<string, unknown> | ||
updatedAt: number | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
pluginCreator___NODE: Identifier | ||
pluginCreatorId: Identifier | ||
componentPath: SystemPath | ||
ownerNodeId: Identifier | ||
} | ||
|
||
// also inlined | ||
export interface IQueryResult { | ||
errors?: Array<Error> | ||
data?: any | ||
} | ||
|
||
export class GraphQLEngine { | ||
constructor({ dbPath }: { dbPath: string }) | ||
runQuery(query: string, context: Record<string, any>): Promise<IQueryResult> | ||
findPageByPath(pathName: string): IGatsbyPage | undefined | ||
} |
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
Oops, something went wrong.