gatsby-source-graphql | Gatsby source plugin for pulling in data from GraphQL APIs | GraphQL library
kandi X-RAY | gatsby-source-graphql Summary
kandi X-RAY | gatsby-source-graphql Summary
A Gatsby source plugin for pulling in data from GraphQL APIs.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of gatsby-source-graphql
gatsby-source-graphql Key Features
gatsby-source-graphql Examples and Code Snippets
Community Discussions
Trending Discussions on gatsby-source-graphql
QUESTION
While building the gatsby project, I faced this kind of error.
...yarn develop
ANSWER
Answered 2021-Oct-14 at 12:26Finally, this problem has been solved.
Using yarn instead of using npm solved the problem.
Remove node_modules and yarn install
After that, the problem has gone away.
Thank you.
QUESTION
I've set up an apollo federation architecture accessible via a gateway. I want to access it via gatsby using the official plugin gatsby-source-graphql. I've followed their documentation and attempted to include the plugin with the "simple" example.
When I run yarn build
on my gatsby project I get the following termanal output:
ANSWER
Answered 2021-Oct-15 at 20:42The gatsby plugin will attempt to retreive the schema from your apollo-server. Ensure that introspection is enabled in production so this step does not fail.
QUESTION
Gatsby project compiles successfully on local but failed in netlify: Here is the complete log of deployment:
...ANSWER
Answered 2021-Jun-04 at 17:16After so much of the build try, I realized that the netlify env key AIRTABLE_API_KEY has been altered, fixing the API key resolved the issue.
Note: Use Netlify-cli tool and try to use netlify build --debug
locally
QUESTION
I'm trying to get data from two separate objects in a single query using their WordPress IDs, but I'm getting GraphQLError: The ID input is invalid. Make sure you set the proper idType for your input.
Using the GraphQL IDE in WordPress it fetches all the data as expected, but I get that error in my code. If I set the idType to a string, for example, I get Variable "$editorId" of type "String!" used in position expecting type "ID!".
gatsby-node.js > createPages function:
...ANSWER
Answered 2021-Jun-04 at 04:50Your gatsby-node.js
looks perfect. Your issue is caused by the types of the data context you are sending to the template (videoDetailTemplate
). You are telling to GraphQL that both id
and editorId
are ID
types while I guess they should be strings.
I guess changing this line:
QUESTION
Its my first question, hope I am doing it right. I am trying to make a gatsby frontend for my woocommerce and its all fine. Up untill now all my queries has worked just fine, but when I make a query to get the cart information, it always comes up empty on my localhost://8000/___graphql but in the wp graphiql i can see it just fine.
here is my gatsby-config I guess this is where the problem would be.
...ANSWER
Answered 2021-Feb-20 at 08:55This is because your localhost:8000/___graphql
is generated on the build-time, at this point, the cart will be always empty since the user has not been allowed to fill it yet.
Your WP GraphiQL API is an asynchronous API that gets the data in real-time, on-demand as the user fills the cart so it will always contain the as soon as the requests are done. To "connect" both, you will need to perform some fetch/post request to your API.
You can read for further information in Build Time and Client Runtime Data Fetching.
QUESTION
I have a working Gatsby install that I've been adding to, however, in trying to build in some graphQL build-time data fetching, I've run into an issue that causes error when running npm start (gatsby develop) or gatsby build.
I installed gatsby-source-graphql as described here: https://www.npmjs.com/package/gatsby-source-graphql
And I included it in my gatsby-config.js like this: ...ANSWER
Answered 2021-Feb-05 at 00:25I started creating a minimal reproduction and adding everything back one by one, but decided to play more with my first setup for a little...and I'm glad I did.
Here's what caused the issue:This Gatsby install is part of a Project Template we use which includes backend code, front-end, pipeline deployment scripts, etc. The structure is similar to:
ProjectTemplate folder
- client folder
- server folder
- other folders
The Gatsby install lives in the client folder but occasionally I need to go into the root folder to do certain things.
So what happened!?I accidentally installed gatsby-source-graphql
into the root folder instead of the client folder. That's all.
I should have picked this up when I ran gatsby info --clipboard
as it's clearly not listed as a dependency.
QUESTION
I'm looking to work with Gatsby.js' File System Route API to generate pages from collections in a private GraphQL API. It seems like the File System Route API always uses an 'all' collection request to generate these (allFile
, allSite
, allPost
, etc).
Because my data is coming from a separate API, there is no equivalent 'all' collection in Gatsby's schema, and my data is also namespaced inside a field by the gatsby-source-graphql
plugin.
Is it possible to define my own 'all' collection for Gatsby to use? I would like to alias allFacilities
to my-remote-api { facilities }
, but I'm not sure if that's possible.
If not, is there another way?
...ANSWER
Answered 2021-Jan-19 at 19:49File System Route API is the new brand was developed by Gatsby (^2.26.0
) to create pages dynamically, removing the GraphQL query of the gatsby-node.js
and using a syntax notation in the /pages
folder ({}
,[]
,()
, etc).
Following your use-case, you will need to infer and modify the schema by prefixing the "all" keyword (maybe using createNodeFactory
and createNodeHelpers
from gatsby-node-helpers package
, without knowing exactly your data schema and structure it's difficult to guess a sample code), but the idea is:
QUESTION
we are building a website where I fetch data from a GraphQL API, the website content is somewhat dynamic, so that we use Apollo Client for some of the content, this makes the website somewhat slow compared to the static sites and is not a great user experience.
I tried binding content with gatsby-source-graphql, for a query that for example fetches a list of items that can be updated every few hours or every few weeks. Having to build to make this data always static is not a very great solution, because we have limited build time and we want to make the content somewhat updated.
Is a custom data source plugin a possible solution for this? or which other solutions are there for content updates, so that we dont have to rebuild?
...ANSWER
Answered 2020-Aug-14 at 11:59What you are trying to implement is called webhook, however, due to Gatsby's limitations (being a static site generator) the site must be rebuilt to gather the new data in order to create your new static pages based on your updated content.
If you think of how Gatsby works (in the build-time it fetches all data-sources and generates a static HTML with all your JavaScript bundle and logic behind) you will see that you can't bypass a new data fetching without rebuilding the site.
A webhook will create a connection between your CMS and your site, there you trigger a build once the new data is created, updated, or deleted.
If your content comes from an outer API, and you don't care about SEO, you can create an API request once the user enters your site to populate it with your content, however, you'll lose all the advantages that Gatsby provides.
QUESTION
I use gatsby-source-git to pull files from Github repository. It worked well, but I added some files into repository and I am not able to pull new files into my Gatsby project.
If I run this query in http://localhost:8000/___graphql
:
ANSWER
Answered 2020-May-30 at 07:01There only two files missing from the Tutorials
folder: step-by-step-guide-how-to-buy-agoras.md
and step-by-step-guide-how-to-store-agoras.md
.
I think that the issue is with the formatting of the frontmatter in these files, not with gatsby-source-git
.
As you can see, hat sets them apart from the other files is that they both have colon inside a value:
title: Agoras: How to Store
description: Agoras: How to Buy
You need to add quotes around those:
title: "Agoras: How to Store"
description: "Agoras: How to Buy"
Your query probably failed at parsing these, hence the files didn't appear. Let me know if this fixes your issue!
QUESTION
My Gatsby website is not generating proper title tags on SSR. When I build the website all I get on my generated files are . I'd appreciate help to find the problem and solve as I have no idea which might be the issue after a long debugging process.
Relevant files:
package.json
...ANSWER
Answered 2020-Apr-26 at 19:06Can you try something like title = {title} passing it in as a props of helmet rather than as the title tag you have like above
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install gatsby-source-graphql
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page