Questions

  • Query with array in graphql

    0 I want to return all items that are not in my arrays. Some think like below but in graphql-aws world: query( collection(db, "users"), where("id", "not-in", […likedUserIds, …dislikedUserIds]) ) I tried: const { data } = await API.graphql( graphqlOperation(getUsers, { filter: { id: { ne: […likedUserIds, …dislikedUserIds]} }, }) ); But this says "Variable ‘ne’ […]

  • GraphQL skip after index

    0 I’m trying to query and return a sorted list (ABC-sort on title) where all items above a specified limit, say 10, include all columns. For everything after that index, include only metadata like id and title. Is this possible in a single GQL query or do I need one query for full data and […]

  • Graphql codegen is always type unknown

    1 I’m working in a SvelteKit project and want to use gql codegen, but all queries are typed as unknown. Ts file: import { graphql } from ‘$lib/gql/index.js’; export const getPostById = graphql(` query GET_ARTICLE($id: bigint!) { articles_by_pk(id: $id) { content created_at slug updated_at title } } `); codegen.ts import type { CodegenConfig } from […]

  • Is it bad to add your postgres connection directly in your graphql resolver?

    0 If I wanted to use the lower level Postgres package from NPM called pg inside my Apollo server so I don’t have to use an ORM. Is it considered bad practice to pass the connection into the resolver directly? Example: // ./db/index.ts import { Pool } from ‘pg’ const pool = new Pool({ user: […]

  • Impossible to use @graphql-codegen/cli correctly, Error: Cannot find module ‘stream/web’

    0 I have some problems using graphql-codegen. Here’s the best description I can give, hope it helps with the resolution. My work environment: Windows 10 Non-admin user NodeJS 16.0.0 NPM 7.24.2 Typescript 5.2.2 Apollo server express 3.12.1 GraphQL 15.8.0 The error is obtained when (according to the documentation) I init with this command: npx graphql-code-generator […]

  • WordPress Gatsby get parent props

    0 I’m a grapql newby and struggling to get the parent props from current page. In gatsby-node.js I create all wordpress pages with: createPage({ path: `${page.node.uri}`, component: PageTemplate, context: { id: page.node.id, title: page.node.title, parentId: page.node.parentId }, }) Then on the page I use following to get data from current page with: query($id: String!) { […]

  • How to do counts in batch for graphql data loader?

    0 I’m implementing a Graphql resolver for complex datatype. I try to use a data loader to avoid N+1 problem. I have a datatype with a counter. Therefore, in one graphql query I need to perform user counting multiple times for defferent types. Currently, I’m trying to combine multiple COUNT(*) queries within one SQL query. […]

  • Flutter Xcode 15 Error (Xcode): DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS

    27 upon upgrading my Xcode today to version 15, I receive the following error when building my app for IOS: Error (Xcode): DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead It appears some specific dependencies are causing this issue, in my case: objectbox_flutter_libs: ^2.2.1 firebase_core: ^2.16.0 I have no idea how to solve […]

  • Is there anyway to store related 1-m entities in sea orm for quering with graphql?

    0 so, for example i have user entity which has related adverts (one user -> many adverts) use async_graphql::{self, SimpleObject}; use chrono::NaiveDateTime; use sea_orm::entity::prelude::*; #[derive(Clone, Debug, PartialEq, DeriveEntityModel, SimpleObject)] #[sea_orm(table_name = "user")] #[graphql(name = "User")] pub struct Model { #[sea_orm(primary_key)] pub id: i32, pub created_at: NaiveDateTime, pub updated_at: NaiveDateTime, pub name: String, pub surname: String, […]

  • Can a GraphQLHttpClient be instantiated against an in memory server

    0 Hoping to run integration tests against an in memory server. If I were to create the in-memory server using WebApplicationFactory<Program>, how would I instantiate a GraphQLHttpClient against it? The constructors for GraphQLHttpClient expect an endpoint. I know I could run integration tests against an in memory server in dotnet core 7.0 using an HttpClient […]