-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create FaustContext and Faust template `queries` property * Implement new method of fetching queries with their own variables * Remove unneeded context check * Fix linting issues * Allow typing for `useFaustQuery` * Update package-lock.json * WIP: set queries in Faust Context * Fix types * Remove unneeded properties of single.js * Refactor WordPressTemplate * Wrap up final touches for WordPressTemplate * <WordPressTemplate/> tests * Finish test for WordPressTemplateInternal * update package-lock.json * Fix failing builds * use FaustQueries type * Add error boundary for when both `template.queries` and `template.query` are provided * Added changeset
- Loading branch information
1 parent
8dcda28
commit c79c8c2
Showing
12 changed files
with
832 additions
and
211 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,29 @@ | ||
--- | ||
'@faustwp/core': minor | ||
--- | ||
|
||
Added the ability to provide multiple queries to a given Faust Template: | ||
|
||
```js | ||
import {GET_POST, GET_LAYOUT} from './queries.js' | ||
|
||
export default function Component(props) { | ||
} | ||
|
||
Component.queries = [ | ||
{ | ||
query: GET_LAYOUT | ||
}, | ||
{ | ||
query: GET_POST, | ||
variables: (seedNode, ctx) { | ||
return { | ||
id: seedNode.databaseId, | ||
asPreview: ctx?.asPreview | ||
} | ||
} | ||
} | ||
] | ||
``` | ||
**Note:** Your Faust template can use either `Component.queries` or `Component.query`, but not both. |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.