question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I get all the markdown field to GraphQL node field?

See original GitHub issue

Summary

I use @gridsome/source-filesystem and @gridsome/transformer-remark to grab field data to GraphQL for use. Is it possible if I can get custom field from markdown file to GraphQL?

Basic example

I have a custom named desc field in my .md file.

// a blog post md file
---
title: this is a blog
desc: this is descripton
---

This is a blog post

How can i config to fetch it successfully from query?

<page-query>
  query Posts ($page: Int) {
    allPost (page: $page) {
      edges {
        node {
          title
          desc
        }
      }
    }
  }
</page-query>

Include a basic example or links here.

Motivation

Why are we doing this? What use cases does it support? What is the expected outcome?

Because we may use custom field to define additional categories.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
danieldockicommented, May 7, 2019

@namoda378 I did not understand your solution

I also need a similar solution…

---
path: home-page
main:
  about: >-
    **Bold Text**

    New Paragraph
  description: The Description
  title: The Title
---
0reactions
jlp0328commented, Aug 13, 2019

@freshyill I reverted to 0.2.1 for the time being and this worked to allow for custom fields. Hope that helps!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Customizing the GraphQL Schema - Gatsby
Every markdown post file is hereby transformed into a “node” object in the ... GraphQL schema with the Node interface, which describes the...
Read more >
How to use createResovers to convert a Markdown FIELD (not ...
You can find out the type name in GraphiQL by clicking on the field name in the left column, or holding cmd and...
Read more >
How to create a text/markdown node to process content using ...
In this post, We will show you how you can consume markdown content ... Using createNodeField function to create a new field on...
Read more >
Gatsby Graphql schema customization for beginners
You can fetch data from CMS using Graphql, query images, query markdown based content with a help of a variety of plugins. It's...
Read more >
Advanced GraphQL Usage In Gatsby Websites
markdown into a node with all the fields of remark for rendering markdown as HTML. Lastly, we included plugins in operating on the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found