Skip to content

Commit

Permalink
feat(gatsby): Refine typing on createPages’ graphql function (#14575)
Browse files Browse the repository at this point in the history
* Refine typing on createPages’ graphql function

* Further refinement to createPages’ GraphQL fn to accept variables generic
  • Loading branch information
ryanditjia authored and freiksenet committed Jul 2, 2019
1 parent 49422c9 commit 5bedc01
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/gatsby/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,13 @@ export interface PluginOptions {
export type PluginCallback = (err: Error | null, result?: any) => void

export interface CreatePagesArgs extends ParentSpanPluginArgs {
graphql: Function
graphql<TData, TVariables = any>(
query: string,
variables?: TVariables
): Promise<{
errors?: any
data?: TData
}>
traceId: string
waitForCascadingActions: boolean
}
Expand Down

0 comments on commit 5bedc01

Please sign in to comment.