Tag: graphql
-
Multi-looping with gitlab Graphql API
0 Im trying to get list of all the pipelines and all the jobs from Gitlab that ran in a day using graphql API, Here is the query I have query = """ query($projectPath: ID!, $pipelineCursor: String, $jobCursor: String) { project(fullPath: $projectPath) { pipelines(updatedAfter:"2023-09-06T00:00:00Z",updatedBefore:"2023-09-06T23:59:59Z",status:SUCCESS,first: 100,after: $pipelineCursor,source:"pipeline") { pageInfo{ hasNextPage endCursor } count nodes { jobs(first:…
-
How to use middleware with Nest.js and GraphQL | Nest.js GraphQL Middleware?
0 I’m working on a Nest.js project that utilizes GraphQL for its API, and I’m interested in implementing middleware to handle specific tasks in my GraphQL resolvers. However, I’m having some trouble figuring out how to integrate middleware effectively within the Nest.js and GraphQL ecosystem. Here’s a brief overview of my project’s current setup: I’m…
-
How to Process Uploaded Image with Graphql Apollo with SharpJS in NodeJS?
4 I have a graphql mutation that gets an image from the frontend, and that then is processed and optimized on my server. But I can’t figure out how to pass my image to sharp. Here is my code: const Mutation = { createImage: async (_, { data }) => { const { file }…
-
React function executing multiple times (4 times)
0 My function is executed 4 times ? (I am using GrahQL, Appolo-Client, React) One of the issues is that my query returns set of images, which are hosted on S3 and page keeps refreshing with new urls. import React, { useState } from "react" import { useQuery } from "@apollo/client" import styled from "styled-components"…
-
How to pass request headers when using java netflix graphql client?
0 I am using com.netflix.graphql.dgs:graphql-dgs-client:4.9.16 along with HttpClient (JDK 17) I am creating graphql client using below. GraphQLCLient graphQLClient = GraphQLClient.createCustom( host-url, requestExecutor::exec); And my request executor is based on HttpClient and it’s implementation is roughly as below – import com.netflix.graphql.dgs.client.HttpResponse; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpClient.Version; import java.net.http.HttpRequest; import java.net.http.HttpRequest.BodyPublishers; import java.util.List; import java.util.Map;…
-
Cypress stub ‘ECONNREFUSED 127.0.0.1:3000’ error
0 I have a website that sends queries to the server using ‘Apollo graphql client’. I have set up an interface that will be displayed when this website cannot connect to the server, i.e. when it gets an error ‘Error: connect ECONNREFUSED’. I can test this manually by shutting down the server. I want to…
-
Possible abuse of GraphQL Mutations
0 I want to pose a question that has been bothering me for quite some time. A project I am working on has decided (some time ago) to use a UI written in React that communicates with the backend ONLY using GraphQL query/mutations (with all the various Redux, RTK, etc). Now, as long as it’s…
-
How to get all comments in a group filtered by author?
0 I have the following query { group(fullPath: "X") { issues { count } projects { nodes { name issues(sort: CREATED_DESC, state: opened ) { count edges { node { iid title description notes { nodes { id body author { name } } } } } } } } } } It gives me…
-
Remove read-only fields before mutation in GraphQL
10 I’ve got a type called Article in my schema: type Article { id: ID! updated: DateTime headline: String subline: String } For updates to it, there’s a corresponding input type that is used by a updateArticle(id: ID!, article: ArticleInput!) mutation: input ArticleInput { headline: String subline: String } The mutation itself looks like this:…
-
NestJS + GraphQL: How to avoid circular dependencies in resolvers
2 Let’s say i have two entities: // user.entity.ts @ObjectType() @Entity() export class User { @Field() @PrimaryGeneratedColumn(‘uuid’) id: string; @Field() @Column({ unique: true }) username: string; @Column({ select: false }) password: string; @Field(() => [Task]) @OneToMany(() => Task, (task) => task.author) authorOfTasks: Task[] } and // task.entity.ts @ObjectType() @Entity() export class Task { @Field() @PrimaryGeneratedColumn(‘uuid’)…