gridsome / gridsome/gridsome.org
Alias multiple paths in template documentation
- Dominant language
- Vue
- Stars
- 292
- Forks
- 301
- PR merge metrics
- No merged PRs in 30d
Description
Thank you for this amazing project!
While learning, I tried to implement a secondary view (template) for a particular node type. Following the example in `templates.md` (https://github.com/gridsome/gridsome.org/blob/master/docs/templates.md / https://gridsome.org/docs/templates/) , I queried both paths:
```
query ($id: ID!) {
product(id: $id) {
path # path to the default template
path(to:"reviews") # path to the reviews template
}
}
```
but this of course does not work. I didn't yet know the concept of aliases in GraphQL, so it may be instructive to either revise the example to include an alias, or do not include `path` twice.
```
path
reviewPath: path(to:"reviews")
```
Kind regards
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with docs/templates.md and compare the published templates documentation with the reported GraphQL query. Update the example so repeated path fields use an alias, or remove the duplicate field; done means the example is valid and clearly shows how to retrieve both template paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100