Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

201
Views
Graphql fetch api not returning data

I am learning Next.js and GraphQL. I have the following code.

I am trying to return the following query

export async function getStaticProps() {
   const client = new ApolloClient({
      uri: "https://data.objkt.com/graphiql/",
      cache: new InMemoryCache(),
   })

   const{data} = await client.query({
      query: gql`
         query{
           fa2_by_pk(contract: "KT1LHHLso8zQWQWg1HUukajdxxbkGfNoHjh6") {
             floor_price
           }
         }
      `
   });
   return {
     props: {
       c: data.fa2_by_pk.floor_price,
    }
  }

}

export default function Home(c) {
   console.log(c);

However I do not seem to be getting the data back. This is what I see

{}
  [[Prototype]]: Object

What am I doing wrong?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The endpoint as I visit it now is an interactive igraphql endpoint. Making the same request and looking at the network request, the endpoint you should be using is

https://data.objkt.com/v1/graphql

I can't speak to what authentication you may require.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!