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

Update BnfImporter to also import basic paragraphs. #1874

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

rasben
Copy link
Contributor

@rasben rasben commented Dec 17, 2024

This feels a bit dirty, but for now, until we've cleared how to deal with GraphQL schemas/codegen, it'll do.
Only text_body paragraphs are imported.

Making some assumptions on how graphql_compose builds the links
(as there is no way of doing it reverse, as far as I can see..),
we build a query that looks up available fields, on paragraphs
we support.

This feels a bit dirty, but for now, until we've cleared how to
deal with GraphQL schemas/codegen, it'll do.
Only text_body and accordion paragraphs are imported.
@rasben rasben force-pushed the bnf-text-paragraph branch from ff928f9 to 99a1fd3 Compare December 23, 2024 15:00
@rasben rasben changed the title Update BnfImporter to also import text paragraphs. Update BnfImporter to also import basic paragraphs. Jan 1, 2025
GRAPHQL;

// Loop through allowed paragraphs and add their structures.
foreach (self::ALLOWED_PARAGRAPHS as $graphBundle => $drupalBundle) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest to fold this out in a helper method that deals with the "inside" of the paragraphs section.

I think at the end we'll end up with a getQuery that just calls getFields which recursively generates the needed GraphQL.

@rasben rasben merged commit b4288c2 into develop Jan 2, 2025
23 checks passed
@rasben rasben deleted the bnf-text-paragraph branch January 2, 2025 13:00
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