Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alias multiple paths in template documentation #550

Open
jblachly opened this issue Dec 29, 2020 · 0 comments
Open

Alias multiple paths in template documentation #550

jblachly opened this issue Dec 29, 2020 · 0 comments

Comments

@jblachly
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant