Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

204
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda