Questions

  • How to make a query in Apollo Client properly?

    0 I’m new to Apollo Client and I want to test API endpoint to fetch the data. const client = new ApolloClient({ cache: new InMemoryCache(), link: new HttpLink({ uri: "https://api.thecatapi.com/v1/breeds", useGETForQueries: true }), }); client .query({ query: gql` { id name } `, }) .then((result) => console.log(result)) In data field I keep getting undefined. I […]

  • design APIs using HTTP methods

    0 I was was below question in Netskope system design interview recently i.e. design APIs for below functionalities (full URL path with HTTP method) and I could not answer well so I was rejected. I pasted my solution below. I could not find a solution using google search. Can you please provide some solution? 1. […]

  • What is the correct way to delete a post in within a graphql subscription?

    1 I’m working on a project where I have posts that are created and shown on a screen. I’ve done this using graphql subscriptions for real time updating of posts, but I need the user to also be able to delete their own posts and for that update to be shown in real time. The […]

  • Issue with GraphQL and TypeORM – Fetching Products with Images

    0 Certainly, here’s a possible Stack Overflow question you could use to get help with your issue: Title: Issue with GraphQL and TypeORM – Fetching Products with Images Description: I’m working on a GraphQL API using TypeORM as the ORM to interact with my PostgreSQL database. I’m currently facing an issue when trying to fetch […]

  • Graphql in apollo client: local data is not normalized

    0 I want to normalize (i.e. flatten nested elements) my graphql’s local cache for efficiency reasons (otherwise a change in a nested item would redraw all components). My understanding was that Apollo would automatically normalize the cache… but apparently it seems like I misunderstood. Indeed, if I do: const IS_LOGGED_IN = gql` query IsUserLoggedIn { […]

  • Call Amplify.configure() before using any methods on the category. | SwiftUI

    0 When I start my project I got this error. How can I fix this problem. I am trying to use Graphql without Apollo SDK. Error: Failed to initialize Amplify with ConfigurationError: AWSS3StoragePlugin.AWSS3StoragePlugin cannot be added after Amplify.configure(). Recovery suggestion: Do not add plugins after calling Amplify.configure(). /Users/ufukkosker/Library/Developer/Xcode/DerivedData/ArtApp-xxxxxxxhzyxxxxx/SourcePackages/checkouts/amplify-swift/Amplify/Categories/DataStore/DataStoreCategory.swift:21: Fatal error: DataStore category is not configured. […]

  • Error encountered while automatically updating the cache when creating a CompanyQuote component

    0 I’m working on a project where I’ve created a backend script to handle GraphQL requests. I have a file called company.graphql that contains a query to retrieve information about a company and its related quotes. Here’s a snippet of the script query Companie($id: String!) { companie(id: $id) { attachmentId companieQuotes { attachmentId } } […]

  • Apollo client: how to create client-side mutations

    0 TL;DR: In Apollo client, how can I create client mutations usable with useMutation now that local resolvers are removed? (useful for debug, abstraction, reusability…) Long version: I’m learning how to use Apollo client to deal with a local nested state. For now, I’m using something like: client.writeQuery({ query: IS_LOGGED_IN, data: { isLoggedIn: false, }, […]

  • Error: “Query.getAllBooks” was defined in resolvers, but not in schema

    0 I’m currently working on a small Nest.js application where I want to create a GraphQL query to retrieve an array of books. However, I’m encountering an issue where I’m not getting the expected response. I’ve provided the relevant code snippets below. Can someone please help me identify what I might be doing wrong? src/books/books.dto.ts […]

  • Why the following graphql schema does not compile with HotChocolate?

    0 I’m trying to put together a more complex stuff than Getting started guide with HotChocolate and I hit a wall, and the documentation does not help. I have multiple questions: What I’m doing wrong here? I went through all the examples they have and it seems I’m doing the right thing, but the error […]