Need to POST Data to REST API using GraphQL Connector to support GraphQL Mutations

Hi,
I am able to use GraphQL Connectors successfully to fetch data from REST end point. But I need a way to POST data to REST end point to support GraphQL mutations. I would like to do this with NO CODE approach using GraphQL Connectors than using custom resolvers.

Can you please share concrete code snippets and details to do this. If this is not yet supported, please share what the plans are

Hi! We have an example of using a POST requests for a mutation field in the docs here: Common Patterns for Apollo Connectors - Apollo GraphQL Docs

Please let us know if this doesn’t meet your needs!

You should come to my livestream tomorrow on connectors! I’m going to follow up with questions after the stream in this thread and you can find a link for the stream there: [Connectors Live] Stripe Q&A

Here’s the example POST mutation we’re going to be building in the stream tomorrow and it’s going to cover Strip checkout session:

type Session {
  id: ID!
  url: String
}
type Mutation {
  createSession(items: [LineItemInput!]!): Session
    @connect(
      source: "stripe"
      http: { 
        POST: "/checkout/sessions"
        body: """
          mode: $("payment")
          line_items: $args.items 
          success_url: $("https://my-website.com")
        """
      }
      selection: """
        id
        url
      """
    )
}

input LineItemInput {
  price: ID!
  quantity: Int
}

After the stream we’re going to have a couple additional examples out there and a space to share more. I’ll have more concrete examples to show you soon :pray:

Thank you very much @lennyburdette. As of now if I have to use GraphQL Connnectors, I have to use GraphOS and GraphOS is cloud offering but can’t be run on prem right? Below is quick question:

  1. Does this mean, if I have subgraph using GraphQL Connectors for REST, I need GraphOS Cloud subscription and my REST call is actually executed in Cloud not on PREM and my local Apollo Router gets GraphQL response to On prem - based on Cloud executed REST call - that gets mapped to GraphQL Response by GraphOS in Cloud?

  2. Is there any way we can get GraphOS license but get all this executed purely On Prem? Can you please point to any documents if this is possible?

The REST API call is done by the router itself, GraphOS has nothing to do with it other than licensing. And the current GraphOS trial allows for self-hosting router.