Skip to content

Commit 5bedc01

Browse files
ryanditjiafreiksenet
authored andcommitted
feat(gatsby): Refine typing on createPages’ graphql function (#14575)
* Refine typing on createPages’ graphql function * Further refinement to createPages’ GraphQL fn to accept variables generic
1 parent 49422c9 commit 5bedc01

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/gatsby/index.d.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,13 @@ export interface PluginOptions {
600600
export type PluginCallback = (err: Error | null, result?: any) => void
601601

602602
export interface CreatePagesArgs extends ParentSpanPluginArgs {
603-
graphql: Function
603+
graphql<TData, TVariables = any>(
604+
query: string,
605+
variables?: TVariables
606+
): Promise<{
607+
errors?: any
608+
data?: TData
609+
}>
604610
traceId: string
605611
waitForCascadingActions: boolean
606612
}

0 commit comments

Comments
 (0)