graphql

How to update dynamically of multiple rows in one table using Graphql

▼魔方 西西 提交于 2021-02-07 14:55:24
问题 I am new to graphql hasura and i'm having this issue how to update multiple rows in one table, because usually i update only one row per table. i want to update multiple rows in a dynamic way I have for example existing rows data. id: 1, name: 'rosie', age: 12 id: 2, name: 'jane', age: 20 id: 3, name: 'rafaela', age: 25 and I want to edit the 2 rows only. id: 1, name: 'rosie update', age: 12 id: 2, name: 'jane update', age: 21 i have an array of users. it can be 1 or more than 1 users that

How to update dynamically of multiple rows in one table using Graphql

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-07 14:55:20
问题 I am new to graphql hasura and i'm having this issue how to update multiple rows in one table, because usually i update only one row per table. i want to update multiple rows in a dynamic way I have for example existing rows data. id: 1, name: 'rosie', age: 12 id: 2, name: 'jane', age: 20 id: 3, name: 'rafaela', age: 25 and I want to edit the 2 rows only. id: 1, name: 'rosie update', age: 12 id: 2, name: 'jane update', age: 21 i have an array of users. it can be 1 or more than 1 users that

Retrieve the object ID in GraphQL

大憨熊 提交于 2021-02-07 14:47:00
问题 I'd like to know whether it is possible to get the "original id" of an object as the result of the query. Whenever I make a request to the server, it returns the node "global identifier", something like U29saWNpdGFjYW9UeXBlOjEzNTkxOA== . The query is similar to this one: { allPatients(active: true) { edges { cursor node { id state name } } } and the return is: { "data": { "edges": [ { "cursor": "YXJyYXljb25uZWN0aW9uOjA=", "node": { "id": "U29saWNpdGFjYW9UeXBlOjEzNTkxOA==", "state": "ARI",

Retrieve the object ID in GraphQL

拈花ヽ惹草 提交于 2021-02-07 14:44:35
问题 I'd like to know whether it is possible to get the "original id" of an object as the result of the query. Whenever I make a request to the server, it returns the node "global identifier", something like U29saWNpdGFjYW9UeXBlOjEzNTkxOA== . The query is similar to this one: { allPatients(active: true) { edges { cursor node { id state name } } } and the return is: { "data": { "edges": [ { "cursor": "YXJyYXljb25uZWN0aW9uOjA=", "node": { "id": "U29saWNpdGFjYW9UeXBlOjEzNTkxOA==", "state": "ARI",

createReadStream() throwing RangeError: Maximum call stack size exceeded when uploading file

北战南征 提交于 2021-02-07 12:19:56
问题 I am trying to use Apollo Server's Upload scalar to send files to S3 directly. My schema: const { gql } = require('apollo-server-express') module.exports = gql` extend type Mutation { createPicture( name: String! picture: Upload! ): Picture! } type Picture { name: String! picture: String! } ` Resolver: const { combineResolvers } = require('graphql-resolvers') const isAuthenticated = require('./auth') const { uploadPhoto } = require('../services/picture') module.exports = { Mutation: {

createReadStream() throwing RangeError: Maximum call stack size exceeded when uploading file

空扰寡人 提交于 2021-02-07 12:19:01
问题 I am trying to use Apollo Server's Upload scalar to send files to S3 directly. My schema: const { gql } = require('apollo-server-express') module.exports = gql` extend type Mutation { createPicture( name: String! picture: Upload! ): Picture! } type Picture { name: String! picture: String! } ` Resolver: const { combineResolvers } = require('graphql-resolvers') const isAuthenticated = require('./auth') const { uploadPhoto } = require('../services/picture') module.exports = { Mutation: {

graphql, how to design input type when there are “add” and “update” mutation?

喜夏-厌秋 提交于 2021-02-07 05:18:37
问题 Here are my requirements: "add" mutation, every field(or called scalar) of BookInput input type should have additional type modifiers "!" to validate the non-null value. Which means when I add a book, the argument must have title and author field, like {title: "angular", author: "novaline"} "update" mutation, I want to update a part of fields of the book, don't want to update whole book(MongoDB document, And, I don't want front-end to pass graphql server a whole big book mutation argument for

Multiple Queries/Mutation in Apollo 2.1

心不动则不痛 提交于 2021-02-06 08:46:57
问题 I need some help using the new Query and Mutation component in Apollo 2.1, especially with multiple queries and mutations. I have the following problems: I have a graphql request that depends on a previous graphql result, how can I deal with this? How do I add two different mutations (in my component I need to do two different actions) in a component that already has a query? 回答1: edit 2019/08/24 from the Apollo docs: The new hooks API for Apollo Client is a simpler way to fetch data in your

Multiple Queries/Mutation in Apollo 2.1

点点圈 提交于 2021-02-06 08:45:51
问题 I need some help using the new Query and Mutation component in Apollo 2.1, especially with multiple queries and mutations. I have the following problems: I have a graphql request that depends on a previous graphql result, how can I deal with this? How do I add two different mutations (in my component I need to do two different actions) in a component that already has a query? 回答1: edit 2019/08/24 from the Apollo docs: The new hooks API for Apollo Client is a simpler way to fetch data in your

Mapping array of images leads to the same image repeating on every instance

这一生的挚爱 提交于 2021-02-05 11:34:50
问题 Im trying to map an object from an array of arrayed images into an image gallery on separate product pages (coming from strapi). The correct number of images appear but it repeats the same image over them. Even on product pages that shouldn't include that image in their respective array. examples - https://imgur.com/a/PKlpofy Ive checked the source and the image src links are all different versions of the same image. - https://imgur.com/a/968w77b GraphIQL - https://imgur.com/a/HvgMA8r Any