Category Archives: cannot query field frontmatter on type markdownremark

Cannot query field frontmatter on type markdownremark

GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Already on GitHub? Sign in to your account. If you have no markdown files in your page directory and have gatsby-transformer-remark enabled, querying for allMarkdownRemark throws an error.

I would expect the query to be empty instead, as the support is there but there are no nodes. It looks like the magic is for every node type registered in this case MarkdownRemark a field for all[Typename] in this case allMarkdownRemark is added to RootQueryType :.

Line 13 in ff It was immensely confusing to install the transformer, have it in the config, yet have my queries marked as invalid. I spent a while debugging until I realized it was due to not having an existing. This expectation is from the way GraphQL generally works There is a dividing line between the schema and the data in the schema, and that separation is broken when it comes to Gatsby and its plugins here.

This one caught me too; I agree it's not the largest of issues but I think it would be a move that improved the developer experience. The core issue for me was that my first thought when it occurred was not "oh, I don't have any markdown files in that folder yet", but rather "why hasn't the plugin registered the type? There must be an issue with how I installed and configured the plugin And that led me on a bit of a wild goose chase.

So this is interesting. I'm a bit surprised this is causing confusion. Let me try to explain my mental model for these parts of Gatsby. They just "source" data from remote sources or "transform" data that source plugins pull in. So they don't create a schema, they create data nodes in Gatsby-speak which after they've finished their work, another Gatsby system comes along and infers a GraphQL schema from the nodes. Transformer plugins don't need to know the type of nodes they're creating as often the type is only known at runtime e.

I get this is confusing as there's multiple data transformations going on and many layers of types going on as well. I suppose a solution could be if a a transformer plugin only creates "static" types e.

A (Minor) Problem

MarkdownRemark then b it could register with Gatsby this type name with any fields in knows for sure would be in the eventual type generally not much. Perhaps we just need to do a better job in docs explaining the setup so it's less surprising what's going on? KyleAMathews What you said makes full sense! The confusion on my part I can't speak for LegNeato came from making the assumption that the transformers have any say whatsoever in the graphql schema generation. I think you're right, a documentation solution is probably enough — just telling users that transformers return just data nodes in the same sense source plugins do.

I can't think of a reason why you'd leave a transformer in if it wasn't transforming anything.Error: We cannot apply field access to the type Date. Go to Solution. The error seems to be caused in step "Added Custom1" because [end] cannot be accessed within List. Select rough explanation. View solution in original post. Click for the top entries. Turn on suggestions. Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for. Search instead for. Did you mean:. Error: We cannot apply field access to All forum topics Previous Topic Next Topic. FromRows Json. Document Binary.

GraphQL Node Types Creation

Decompress Binary. Base64Compression. Round Number. Distinct List. Transform List. Dates [start], x, duration 28, 0, 0, 0Date. AddColumn "Added Custom", "Custom. Mark my post as a solution!

Proud to be a Super User! Labels: Need Help. Message 1 of 5.GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Already on GitHub? Sign in to your account. I have used two browsers just in case of cache issue.

cannot query field frontmatter on type markdownremark

Possibly related to One works fine and builds without a problem. The error jonathan-chin is seeing is probably in conjunction with If the thebetterjort 's repo includes markdown files, it may also be consequent to The repo does include markdown files.

It's working after I recreated the config. There is not enough context in stuff you posted to figure out what's wrong. That's where you'll find it! Thanks, for the help. Using Node v9. More information on your environment and the commands you're running could be useful, but you might also try doing a fresh clone of the project like I did to see if that sorts things out. Hey flipactual pieh. Thanks for the help been migrating my work folders from one user to the other to test if the path was the problem.

Turns out actually that was the problem. Glad to hear it's working droidMakk! Per this conversation and comment I'm going to close the issue, but feel free to reopen or a create a new issue if the problem pops back up again. Skip to content. Dismiss Join GitHub today GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Sign up. New issue. Jump to bottom. Labels status: needs more info type: question or discussion. Copy link Quote reply.

cannot query field frontmatter on type markdownremark

This comment has been minimized.GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account. Hi, I'm currently using your theme to build my personal blog. Could you please provide me about what's wrong with it?

Hi and thanks for trying out my starter! It seems that you've forgotten some brackets within plugins array. Replace it with this:. But I've tried it out and still getting the same error. I think that causes the error is from "query" in the gatsby-node.

When I trying to deploy it to netlify. Also, I've tried adding this config to my gatsby-config. The deployment becomes successfully, but it won't trigger the analytics. Somehow I think to add the analytics into it refer to their support : Adding analytics. And followed this issue from StackOverflow. If you don't import gatsby-source-filesystem and gatsby-transformer-remark plugins, no MarkdownRemark node will be created and the GraphQL query will fail as above.

Skip to content. Dismiss Join GitHub today GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Sign up. New issue. Jump to bottom. Copy link Quote reply.GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Already on GitHub? Sign in to your account. Anyone has an quick explanation? Many Thanks! This plugin is needed to make the above GraphQL query work.

It works! Now I will try to add lazy-loading to this thumbnails…. PolGuixe I have used your solution but the responsive image doesn't really work. It's always the same ize that is served whatever the size of the screen… As it is the homepage with a lot of images, I would like to optimize it now.

I have tried also to add the responsiveResolution method and some parameters also base64 but it didn't change anything. Do you have any idea and also to implement the "blur-up"? Big thanks! Ok I found a solution here. Skip to content. Dismiss Join GitHub today GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Sign up. New issue. Jump to bottom. Copy link Quote reply. Here is an exemple of the frontmatter of the index.

This comment has been minimized. Sign in to view. AustinGreen mentioned this issue Nov 10, ImageSharp doesn't work for images in siteMetadata Hello, I don't understand why my image in frontmatter is not converter into imageSharp node. Ok I found a solution here I had an ampty cover field in an other file. Strange behavior. Add the following in gatsby-config. Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment.By using our site, you acknowledge that you have read and understand our Cookie PolicyPrivacy Policyand our Terms of Service.

Sitecore Stack Exchange is a question and answer site for developers and end users of the Sitecore CMS and multichannel marketing software. It only takes a minute to sign up. This question is marked as answered by jan-bluemink but I am facing the problem mentioned in the comment section for the given answered. It is about your GraphQL endpoint, In your end point your configer what you need. Or you can use a predefined config like the.

SearchQuery, Sitecore. If you use a copy of the example: Sitecore. That is another option using a predefined set, and that set is what your found in the Sitecore.

Sign up to join this community. The best answers are voted up and rise to the top. Home Questions Tags Users Unanswered. Asked 2 months ago.

Active 2 months ago. Viewed times. My question is based on already asked question and can be found here Sitecore Filtering by Field Value on Query of GraphQL This question is marked as answered by jan-bluemink but I am facing the problem mentioned in the comment section for the given answered. When i am trying to executing below search query in my GraphQL browser. ItemQuery, Sitecore. What could be the issue? Arvind Gehlot Arvind Gehlot 2, 9 9 silver badges 34 34 bronze badges.GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

Have a question about this project?

cannot query field frontmatter on type markdownremark

Sign up for a free GitHub account to open an issue and contact its maintainers and the community. Already on GitHub? Sign in to your account. I cloned Bricolage. Then I deleted everything except favicon. Is it possible to workaround this problem? If not, what is the appropriate way to populate Kyle Mathews style blog with my own posts? Or is it simply not possible and I should get things done from scratch using one of Gatsby simple starters?

Update: for someone getting the same error, you should remove draft field from GraphQL queries in following files:.

I'm getting the same error. Removed all the blog posts, put in my own and was greeted with this. Then I restored all the previous posts and the error continued. I suspect it might be some cache problem. There hasn't been any time spent on improving the errors in the new stuff so that error is a bit ambiguous. What's happening is in my blog — I add draft: true to frontmatter of draft blog posts.

cannot query field frontmatter on type markdownremark

Then Gatsby, with its new GraphQL data layerconstructs a graphql schema based on my blog posts — which because of my draft: true adds draft as a field in the markdown frontmatter type. Gatsby extracts the graphql queries from pages and runs them and then injects their results as props into the component.

This lets you query for exactly the data you need for a page. But since you removed the markdown files with draft: truethe schema now doesn't include this as a field which means that the query then fails because the field draft no longer exists. Thanks for checking out the 1. I highly resonate with your concerns you've introduced in your blogpost. I would like to discuss that and compare your ideas with mine KyleAMathews is there a way to manually add a field to the schema, in case you want to keep this functionality but don't have any draft pages at the moment ie.

Edit: solved it by adding the property with a default false to pages. Still wonder if there is a way to declare a schema. There is defenitely plan to add way to declare schema after Gatsby v2 is released. Skip to content.

Dismiss Join GitHub today GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Sign up. New issue. Jump to bottom. Getting error 'Cannot query field "draft" on type "Frontmatter". Copy link Quote reply. This comment has been minimized.


This entry was posted in cannot query field frontmatter on type markdownremark. Bookmark the permalink.

Responses to Cannot query field frontmatter on type markdownremark

Leave a Reply

Your email address will not be published. Required fields are marked *