Skip to content

Alias multiple paths in template documentation #550

Open
@jblachly

Description

@jblachly

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions