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

Post are returning expty array #190

Open
adityakoushik11 opened this issue Jan 3, 2022 · 3 comments
Open

Post are returning expty array #190

adityakoushik11 opened this issue Jan 3, 2022 · 3 comments

Comments

@adityakoushik11
Copy link

When i try to connect my gatsby site to ghost API, i am getting posts data as empty array even if i have published posts from ghost cms.

The graphql query i have used to fetch posts is
query GhostPostQuery{ allGhostPost( sort: { order: DESC, fields: [published_at] } ) { edges { node { id title slug } } } }
I have also attached the screenshot of the query and its response.
image

PACKAGE JSON :
`
{
"name": "spet-gatsby",
"private": true,
"description": "Spet - Gatsby React IT & Business Startup Template",
"version": "0.1.1",
"author": "EnvyTheme.com",
"dependencies": {
"@loadable/component": "^5.15.0",
"animate.css": "^4.1.1",
"axios": "^0.24.0",
"babel-plugin-styled-components": "^2.0.2",
"dayjs": "^1.10.7",
"dotenv": "^10.0.0",
"gatsby": "^3.14.0",
"gatsby-awesome-pagination": "^0.3.8",
"gatsby-plugin-gatsby-cloud": "^2.11.0",
"gatsby-plugin-image": "^1.14.0",
"gatsby-plugin-manifest": "^3.14.0",
"gatsby-plugin-next-seo": "^1.9.0",
"gatsby-plugin-offline": "^4.14.0",
"gatsby-plugin-react-helmet": "^4.14.0",
"gatsby-plugin-sharp": "^3.14.0",
"gatsby-plugin-sitemap": "^5.4.0",
"gatsby-plugin-styled-components": "^5.4.0",
"gatsby-source-filesystem": "^3.14.0",
"gatsby-source-ghost": "^4.2.4",
"gatsby-source-strapi": "^1.0.2",
"gatsby-transformer-sharp": "^3.14.0",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-accessible-accordion": "^3.3.5",
"react-dom": "^17.0.2",
"react-feather": "^2.0.9",
"react-helmet": "^6.1.0",
"react-helmet-async": "^1.2.2",
"react-markdown": "^7.1.1",
"react-masonry-component": "^6.3.0",
"react-owl-carousel3": "^2.2.5",
"react-slick": "^0.28.1",
"react-tabs": "^3.2.2",
"sass": "^1.41.1",
"styled-components": "^5.3.3"
},
"devDependencies": {
"path": "^0.12.7",
"prettier": "2.2.1"
},
"keywords": [
"gatsby"
],
"license": "0BSD",
"scripts": {
"build": "npm run clean && gatsby build && node copy-redirects.js",
"develop": "npm run clean && gatsby develop",
"format": "prettier --write "**/*.{js,jsx,ts,tsx,json,md}"",
"start": "npm run develop",
"serve": "gatsby serve",
"clean": "gatsby clean",
"test": "echo "Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/gatsbyjs/gatsby-starter-default"
},
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
}
}

`

@adityakoushik11
Copy link
Author

If i try to fetch posts through API, then i am getting the response
https://www.ionicfirebaseapp.com/blogs/ghost/api/v4/content/posts/?key=

@ydroulis
Copy link

ydroulis commented Jul 6, 2022

I'm having the same problem

@emilianos
Copy link

having the same issue, tried 2 clean installs of Gatsby 4 and Ghost 5 and works initially with the "apiUrl": "https://gatsby.ghost.io",, as soon as I point it to the newly installed Ghost local install, it doesnt fetch anything..
Not sure whats going on..

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

No branches or pull requests

3 participants