Skip to content

Commit

Permalink
Added multiple queries to interface for FaustTemplate (#1847)
Browse files Browse the repository at this point in the history
* Added `queries` property to FaustTemplate interface, which fixes an error when using multiple queries with TypeScript.

Co-authored-by: John Parris <[email protected]>

---------

Co-authored-by: John Parris <[email protected]>
  • Loading branch information
TeresaGobble and mindctrl authored Mar 15, 2024
1 parent a54ce69 commit 16b2384
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/quiet-avocados-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@faustwp/core": patch
---

Added `queries` property to FaustTemplate interface. Fixes an error when using multiple queries with TypeScript.
6 changes: 6 additions & 0 deletions packages/faustwp-core/src/getWordPressProps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ export type WordPressTemplate = React.FC & {
export interface FaustTemplate<Data>
extends React.FC<FaustTemplateProps<Data>> {
query?: WordPressTemplate['query'];
queries?: {
query: DocumentNode;
variables?: (...args: QueryVariablesArgs) => {
[key: string]: any;
};
}[];
variables?: WordPressTemplate['variables'];
}

Expand Down

0 comments on commit 16b2384

Please sign in to comment.