I am trying to fetch data from hygraph by this way
export const getCategories = async () => {
const { categories } = await hygraph.request(
`
query GetGategories {
categories {
name
…
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…
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…
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…
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…
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…
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…
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…
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…
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:…
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…
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…
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…
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…