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

Handle content type after an import with gatsby-source-contentful #4

Merged
merged 1 commit into from
Feb 9, 2019

Conversation

kevee
Copy link
Contributor

@kevee kevee commented Feb 8, 2019

Gatsby source contentful imports Rich Text then resolves all the child nodes, which means embedded entries look like the following node. This PR just checks that the content type of a target embedded entry isn't also located in target.sys.contentType.sys.id.

{
      "data": {
        "target": {
          "sys": {
            ...
            "contentType": {
              "sys": {
                "type": "Link",
                "linkType": "ContentType",
                "id": "contentInlineImage"
              }
            }
          },
          "fields": {
            ...
          }
        }
      },
      "content": [],
      "nodeType": "embedded-entry-block"
    },

@codecov
Copy link

codecov bot commented Feb 8, 2019

Codecov Report

Merging #4 into master will increase coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #4      +/-   ##
==========================================
+ Coverage   98.85%   98.86%   +0.01%     
==========================================
  Files          13       13              
  Lines         174      176       +2     
  Branches       48       49       +1     
==========================================
+ Hits          172      174       +2     
  Misses          2        2
Impacted Files Coverage Δ
src/rich-text-to-jsx.js 98.79% <100%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de3d5ea...ffe6dd3. Read the comment docs.

@connor-baer connor-baer self-requested a review February 9, 2019 05:02
Copy link
Owner

@connor-baer connor-baer left a comment

Choose a reason for hiding this comment

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

Great improvement, thanks for the contribution! 👏

@connor-baer connor-baer merged commit 5ef5bf0 into connor-baer:master Feb 9, 2019
@connor-baer
Copy link
Owner

This change is included in v2.1.1.

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