graphcool

Add an array of Objects to a mutation in apollo-react

别等时光非礼了梦想. 提交于 2021-01-21 04:14:39
问题 I am using react-apollo on the front-end and graphcool on the backend. I have a mutation that creates a tutorial like so: const CREATE_TUTORIAL_MUTATION = gql` mutation CreateTutorialMutation( $author: String $link: String $title: String! $postedById: ID! $completed: Boolean! ) { createTutorial( author: $author link: $link title: $title postedById: $postedById completed: $completed ) { author link title postedBy { id name } completed } } ` It gets called in a submit handler like so... this

Add an array of Objects to a mutation in apollo-react

只谈情不闲聊 提交于 2021-01-21 04:13:08
问题 I am using react-apollo on the front-end and graphcool on the backend. I have a mutation that creates a tutorial like so: const CREATE_TUTORIAL_MUTATION = gql` mutation CreateTutorialMutation( $author: String $link: String $title: String! $postedById: ID! $completed: Boolean! ) { createTutorial( author: $author link: $link title: $title postedById: $postedById completed: $completed ) { author link title postedBy { id name } completed } } ` It gets called in a submit handler like so... this

GraphQL: Filter data in an array

假装没事ソ 提交于 2020-08-01 06:39:11
问题 I'm sure it's a simple thing to do, but I couldn't find anything in either GraphQL's doc or Graphcool's. Say I have an entity with this schema (new GraphQL user, sorry if I make mistake in the schema representation): Book { name: String! author: String! categories: [String!] } How would I do a query for all books that are part of the "mystery" category? I know I can filter with allBooks(filter: {}) , but categories_in: ["mystery"] and categories_contains: "mystery" didn't do the trick. 回答1:

How to send GraphQL mutation from one server to another?

丶灬走出姿态 提交于 2020-01-31 08:35:27
问题 I would like to save some Slack messages to a GraphQL backend. I can use the Slack API and what they call "Slack App Commands" so everytime a message is send to my Slack channel, Slack will automatically send a HTTP POST request to my server with the new message as data. I was thinking using an AWS lambda function to forward this post request to my GraphQL server endpoint (I am using GraphCool). I am pretty new to GraphQL, I've used Apollo to create mutations from the browser. Now I need to

How to send GraphQL mutation from one server to another?

本小妞迷上赌 提交于 2020-01-31 08:34:24
问题 I would like to save some Slack messages to a GraphQL backend. I can use the Slack API and what they call "Slack App Commands" so everytime a message is send to my Slack channel, Slack will automatically send a HTTP POST request to my server with the new message as data. I was thinking using an AWS lambda function to forward this post request to my GraphQL server endpoint (I am using GraphCool). I am pretty new to GraphQL, I've used Apollo to create mutations from the browser. Now I need to

Docker could not find plugin bridge in v1 plugin registry: plugin not found

ぐ巨炮叔叔 提交于 2020-01-03 08:28:33
问题 I am trying to run this command with graphcool: graphcool-framework local up And I am getting this error from Docker, docker could not find plugin bridge in v1 plugin registry: plugin not found My version of Docker is version 18.03.0-ce What is the problem and how can I solve it? 回答1: Are you using Docker for Windows and switched to using Windows containers? The bridge driver isn't available for Windows containers and nat is the equivalent. I'm not familiar with graphcool but it could be that

graphql/graphcool: How to write a mutation that links both a one:one and a one:many relationship

ぃ、小莉子 提交于 2019-12-25 01:34:38
问题 I have a schema as follows: type Artist @model { id: ID! @isUnique createdAt: DateTime! updatedAt: DateTime! name: String! @isUnique songkickId: String shows: [Show!]! @relation(name: "ArtistShow") } type Show @model { id: ID! @isUnique createdAt: DateTime! updatedAt: DateTime! name: String songkickId: String date: DateTime! soldOut: Boolean! pit: Boolean! ages: String! price: String! multiDay: Boolean! artists: [Artist!]! @relation(name: "ArtistShow") venue: Venue! @relation(name: "ShowVenue

How to create nested nodes in one mutation?

浪尽此生 提交于 2019-12-23 09:57:07
问题 Hi I am trying to write data on my https://www.graph.cool/ db with a mutation. My project is a React web-app and I am using Apollo as graphql client and graphql-tag npm package as template literal parser. The problem is that i don't know how to arrange the gql template string for the correct mutation with nested data. My schema looks like this, for example note the field "Addresses" for the type "Company" is an array of "Address" objects type. type Company { name: String! website: String

How to create nested nodes in one mutation?

≡放荡痞女 提交于 2019-12-23 09:55:47
问题 Hi I am trying to write data on my https://www.graph.cool/ db with a mutation. My project is a React web-app and I am using Apollo as graphql client and graphql-tag npm package as template literal parser. The problem is that i don't know how to arrange the gql template string for the correct mutation with nested data. My schema looks like this, for example note the field "Addresses" for the type "Company" is an array of "Address" objects type. type Company { name: String! website: String

How to update all records in a collection using graphql

被刻印的时光 ゝ 提交于 2019-12-21 17:54:02
问题 I'm using Graph.cool graphql as a service and am wondering how to do a mass update to the collection, similar to a SQL update. In my case I need to update the suffix of a url, in the imageUrl column of my database. I need to swap out a {someid}_sm.jpg to {someid}_lg.jpg How do I do that with a graphql mutation? I don't want to reload the entire dataset again and am looking for a way to do it that doesn't involve manually interating through the entire list with a graphql client. mutation {