Questions tagged [graphcms]

A headless CMS built on GraphQL

GraphCMS is a content management system used to quickly build a GraphQL API.

37 questions
0
votes
0 answers

Why Hygraph cms showing 'GraphQL Error (Code: 405)'?

I am trying to fetch data from hygraph by this way export const getCategories = async () => { const { categories } = await hygraph.request( ` query GetGategories { categories { name …
Sujjeee
  • 15
  • 4
0
votes
1 answer

Why Richtext content is not searchable in hygraph/graphcms?

Im try to search content from the query user requested but hygraph not showing the result it only show data if title contains it... export async function getServerSideProps(context) { const { query } = context; const { posts } = await…
Sujjeee
  • 15
  • 4
0
votes
1 answer

How to use fetch multiple api using using getStaticProps in next js

I have a [slug].js page where I'm using getStaticPath and getStaticProps to fetch the data and create static page{ export async function getStaticProps({ params }) { const { posts } = await hygraph.request( ` query…
Sujjeee
  • 15
  • 4
0
votes
0 answers

How to upload icon to GraphCms / GraphQl from react-icon and then render to nextJS?

I want to have the option to upload icon to graphcms and then use the icon in Next.js. I tried to add the "Multi line text" function in graphcms and inside provide the name of the icon like this "AiFillHome". However unfortunately it looks like…
0
votes
0 answers

Nested pages in Hygraph (GraphCMS) with Nextjs dynamic routing

I am trying to create nested pages using Hygraph (GraphCMS) and Nextjs. I thought about using [..slug].js But the problem I have is that writing my slug-like this "page/subpage" the GraphCMS returns the following structure which is not an array or…
devjs11
  • 1,898
  • 7
  • 43
  • 73
0
votes
1 answer

How to pass hygraph (GraphCMS) graphql query to element / div (mapping query to elements)

I can't figure out how to access the query for a element through code. I have query request, but I do now know how to fetch and map the query to elements. Here is the code of query fetch: import { request, gql } from "graphql-request"; const…
Konjak
  • 1
  • 3
0
votes
0 answers

Category isnt pulling up category posts

I am trying to click on a category and pull up premade posts that are under that category for a website. I need the category to pull up blogs that are already created using hygraph(graphcms) and display them on the page for that category. Error im…
NicholasW
  • 1
  • 1
0
votes
1 answer

Is there a way to create multiple relation at once in hygraph?

I am currently using hygraph as CMS. I have two models, posts and tags. I created many to many relation between them. It works when I use the inbuilt content editor. The problem is that I cannot do the same with API. I can only create one relation…
0
votes
0 answers

Tried to make pagination for a blog. Can't fetch data from GraphQLClient / Next.js / Hygraph (previously Graph CMS)

As the title said, I can't get the response data from graphql inside Home component, even though I can fetch data from the same code in getStacticProps. The button with onClick function loadMore doesn't work. I want whenever I click on the load more…
Tue An
  • 11
0
votes
1 answer

Stripe GraphCms typescript Insert Order Property 'metadata' does not exist on type 'string'

I'm working on a 'clone' of ecommerce example from Graphcms using typescript so in the web hook I want to insert an order like const order = { email: session.customer_email, total: session.amount_total, stripeCheckoutId:…
user3887366
  • 2,226
  • 4
  • 28
  • 41
0
votes
1 answer

How to filter (remove) first x items in hygraph api (graphql)?

I am currently getting all posts with the hygraph api. But i like to filter the first x items out of that result set. All posts minus the first x items, No idea how to do it. I am using the graphql api from hygraph formerly known as graphcms. Help…
user6221709
0
votes
1 answer

Graphcms what's Use as title field

I don't understand what's it for Use as title field in graphcms model. Could you explain to me a give me an example, please? Thanks
user3887366
  • 2,226
  • 4
  • 28
  • 41
0
votes
2 answers

React js, limiting post shown

Hi i am just making a blog using next js and graph cms,i just know how to limit the number posts shown, for example if i have 50 posts in the backend i just need 1 post to show, like how to limit it? here, this is what i am talking about const posts…
S.M Naveen
  • 170
  • 7
0
votes
1 answer

graphql-request - Run multiple queries with one request when using getStaticProps?

I am using graphCMS with NextJS and now I am fetching my data which works perfectly fine. But I have 2 queries which I need on the homepage of my website all posts and recent posts. queries.js: import { gql } from "graphql-request"; export const…
Galanthus
  • 1,958
  • 3
  • 14
  • 35
0
votes
0 answers

Graphql upsert with condition

i'm trying to create a simple leaderboard table, i would like to execute a query to insert or update entry if the new score is higher than the previous one, is it possible to achieve this using graphql ? My upsert mutation look like this mutation…
Imrane
  • 1
  • 1