Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

202
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda