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

docs: relationships and links resolving in README #48

Merged
merged 2 commits into from
Apr 14, 2022

Conversation

christianzoppi
Copy link
Contributor

This PR adds some details about the behavior of relationships and links resolving that has been introduced with the update to the V2 of the REST API as the default version in the client. This change in the client was approved and published a long time ago but I think it's better to document clearly this behaviour.

Pull request type

Internal - no Jira link

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Other (please describe): Docs

How to test this PR

If you want to double-check the behavior, you can run this script that will fetch a story that has a reference to a story, that has a reference to another story. You can then check the returned data and see the injected stories in the rel field (2 levels of nesting):

<?php
require 'vendor/autoload.php';
$resolver = new \Storyblok\RichtextRender\Resolver();
$client = new \Storyblok\Client('wI9bYKrVy9nzrrbofXMFOQtt');

$client->resolveRelations('page.rel');
$client->getStoryBySlug('home');
$data = $client->getBody();
var_dump($data);

Copy link

@fernandacanto fernandacanto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@joaokamun joaokamun merged commit 7beb863 into master Apr 14, 2022
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

Successfully merging this pull request may close these issues.

3 participants