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

refactor: remove reference resolve by Contentful SDK and clean up #34561

Conversation

axe312ger
Copy link
Collaborator

This is WIP

The duplicated and bloated reference resolving logic blocks me from finishing #34549.

I want to explore if we can clean it up and release this before this big new major version of the plugin.

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 21, 2022
@@ -6,7 +6,6 @@ exports.contentTypeItems = () => [
type: `Link`,
linkType: `Space`,
id: `uzfinxahlog0`,
contentful_id: `uzfinxahlog0`,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This value is actually never returned by Contentful API.

}
},
"id": "c7LAnCobuuWYSqks6wAwY2a",
"id": "7LAnCobuuWYSqks6wAwY2a",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the c prefixing was long removed. This is some left-over in the snapshots

}
"type": "Link",
"linkType": "Asset",
"id": "6m5AJ9vMPKc8OUoQeoCS4o"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't resolve twice anymore, therefore this is just a link instead of the whole node value

@axe312ger
Copy link
Collaborator Author

Next steps:

The snapshot based tests are mind-buggling as usual. Switching to a more flat structure results in huge change sets in the snapshots.

I'll have a look at this again soon and will check if I can split up the changes and restructure them.

Happy weekend 🎉

@axe312ger axe312ger force-pushed the refactor/contentful-reference-resolving branch from c203a1b to d069d9b Compare January 26, 2022 12:14
@axe312ger axe312ger changed the base branch from master to refactor/contentful-clean-up-tests January 26, 2022 12:16
@axe312ger axe312ger closed this Jan 26, 2022
@axe312ger axe312ger deleted the refactor/contentful-reference-resolving branch January 26, 2022 15:52
@LekoArts LekoArts removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Feb 1, 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.

2 participants