Questions

  • How to hide django default filters from others except admin user?

    1 I have below User graphql API endpoint in my application. Query class Query(UserQuery, graphene.ObjectType): all_users = DjangoFilterConnectionField( UserType, filterset_class=UserFilter) Type class UserType(DjangoObjectType): class Meta: model = User fields = "__all__" interfaces = (graphene.relay.Node,) Filter class UserFilter(FilterSet): user_name_search = CharFilter( method=’user_name_filter’, label=’User Name Search’ ) class Meta: model = User fields = [ ‘user_name_search’, ‘user_id’, […]

  • Graphql Codegen’s client-preset-swc-plugin not working at all

    0 I couldn’t use Graphql Codegen’s client-preset-swc-plugin with Vite at all to reduce the bundle size. It panics when trying to build for production, I’m getting this error: [vite-plugin-pwa:build] failed to handle: failed to invoke plugin: failed to invoke plugin on ‘Some("/home/user/project/web/src/index.tsx")’ Caused by: 0: failed to invoke `/home/user/project/web/node_modules/@graphql-codegen/client-preset-swc-plugin/swc_plugin.wasm` as js transform plugin at /home/user/project/web/node_modules/@graphql-codegen/client-preset-swc-plugin/swc_plugin.wasm […]

  • Apollo GraphQL Server + TypeScript

    17 I’ve been working on a project lately, which has node.js + express + typescript + Apollo server stack. And while researching on Apollo client, I’ve stumbled upon TypeScript section. But nothing like that was for server, which leaves me to freedom of choice in this case. So the question is: are there any best […]

  • Microservice Communication for Graphql APIs

    1 Problem Statement : I have a GraphQl query defined which is responsible for fetching few details from the database. This graphql schema let’s say is defined in microservice-B . Now I want this garphql API to be called by an upstream microservice-A. microservice-A is actually the one which is actually called by our Clients(UI […]

  • C++20’s std::views::filter not filtering the view correctly

    7 I was writing a simple C++ program that generates a list of random integer values from a normal distribution, then takes first N generated items and filters them so that their absolute value is greater than 42. The code i wrote is the following: int main() { //convenience namespace rng = std::ranges; namespace view […]

  • 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 { […]