gridsome.org icon indicating copy to clipboard operation
gridsome.org copied to clipboard

Alias multiple paths in template documentation

Open jblachly opened this issue 3 years ago • 0 comments

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

jblachly avatar Dec 29 '20 16:12 jblachly