Skip to content

Commit

Permalink
#83: comment
Browse files Browse the repository at this point in the history
  • Loading branch information
espen42 committed Oct 15, 2021
1 parent 75be6a0 commit 7e417b3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/selectors/typeSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export type SelectedQueryMaybeVariablesFunc = string |


/**
* Object that configures the handling of a particular content type. All attributes are optional (see examples below):
* - 'query' (used in fetchContent.ts) can be a guillotine query string to use to fetch data for that content type, OR also have a get-guillotine-variables function - by an object with 'query' and 'variables' attributes, or an array where the query string is first and the get-variables function is second.
* Object that configures the handling of a particular content type. All attributes are optional (see examples below), and missing values will fall back to default behavior:
* - 'query' (used in fetchContent.ts) Guillotine query for fetching content data, may also have a function that supplies guillotine variables. So, 'query' can EITHER be only a query string, OR also add a get-guillotine-variables function. In the latter case, 'query' can be an object with 'query' and 'variables' attributes, or an array where the query string is first and the get-variables function is second. Either way, the get-variables function takes two arguments: path (content path, mandatory) and context (next.js-supplied Context from getServerSideProps etc. Optional, and requires that fetchContent is called with the context, of course).
* - 'props' (used in fetchContent.ts) is a function for processing props: converting directly-from-guillotine props to props adapted for displaying the selected page component
* - 'page' (used in BasePage.tsx) is a react component: top-level content-type-specific rendering with the props first fetched from guillotine (and then optionally preprocessed with the function in 'props').
*/
Expand All @@ -36,9 +36,9 @@ export type TypeSelection = {
}

/**
* Object where keys are full XP content type strings (eg. 'my.app:content-type') and values are (optional) type-specific 'TypeSelection' objects; config for how to handle that content type. All attributes in these 'TypeSelection' objecs are optional (see examples below):
* - 'query' (used in fetchContent.ts) can be a guillotine query string to use to fetch data for that content type, OR also have a get-guillotine-variables function - by an object with 'query' and 'variables' attributes, or an array where the query string is first and the get-variables function is second.
* - 'props' (used in fetchContent.ts) is a function for processing props: converting directly-from-guillotine props to props adapted for displaying the selected page component
* Object where keys are full XP content type strings (eg. 'my.app:content-type') and values are (optional) type-specific 'TypeSelection' objects: sets of config for how to handle that content type. All attributes in each 'TypeSelection' object are optional (see examples below), and missing values will fall back to default behavior:
* - 'query' (used in fetchContent.ts) Guillotine query for fetching content data, may also have a function that supplies guillotine variables. So, 'query' can EITHER be only a query string, OR also add a get-guillotine-variables function. In the latter case, 'query' can be an object (with 'query' and 'variables' attributes in it), or an array where the query string is first and the get-variables function is second. Either way, the get-variables function takes two arguments: path (content path, mandatory) and context (next.js-supplied Context from getServerSideProps etc. Optional, and requires that fetchContent is called with the context, of course).
* - 'props' (used in fetchContent.ts) A function for processing props: converting directly-from-guillotine props to props adapted for displaying the selected page component
* - 'page' (used in BasePage.tsx) is a react component: top-level content-type-specific rendering with the props first fetched from guillotine (and then optionally preprocessed with the function in 'props').
*/
export type TypeSelector = {
Expand Down

0 comments on commit 7e417b3

Please sign in to comment.