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

Is resolveRelations supported? #32

Open
brandiqa opened this issue Nov 27, 2020 · 2 comments
Open

Is resolveRelations supported? #32

brandiqa opened this issue Nov 27, 2020 · 2 comments

Comments

@brandiqa
Copy link

Hello,

Is there an option for setting resolveRelations similar to gatsby-source-storyblok. For example, I would like to resolve post.author to an Object. Currently, I am getting a String id.

Thanks for the assistance 🙏

@brandiqa
Copy link
Author

Hey,

I've found the answer through trial and error. This hasn't been documented. Please include this example for those who want to resolve relations:

In gridsome.config.js:

plugins: [
    {
      use: 'gridsome-source-storyblok',
      options: {
        client: {
          accessToken: process.env.STORYBLOK_TOKEN,
        },
        version: process.env.NODE_ENV === 'production' ? 'published' : 'draft',
        types: {
          story: {
            name: 'StoryblokEntry',
            params: { resolve_relations: 'author' },
          },
        },
      },
    },
  ],

@brandiqa
Copy link
Author

brandiqa commented May 8, 2021

Also, you need multiple relations, you need to specify it this way with no "spaces" like this:

          params: {
             resolve_relations: 'post.author,global-reference.reference',
           },

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