View more context

 

wmk

Seen a youtube video on netlify forms, those can forward the form data to a POST API

wmk

So we could forward it to the SilverStripe blog module

unclecheese

The graphql form stuff will render the form UI, but it won’t yet handle the form for you.

unclecheese

Creating mutations and input types for forms is still a todo

wmk

ok. Render Form UI and send to REST instead?

unclecheese
  1. mutation {
  2. createComment(Input: { Comment: "foo", Email: "<mailto:[email protected]|[email protected]>", BlogEntryID: 5 }) {
  3. isSpam
  4. successMessage
  5. }
  6. }
gened

I’ve used Formik forms + Apollo in Gatsby to great effect. You could also support more fields by stringifying your form data and decoding in SS via something like this

  1. mutation updateUserForm($id: Int!, $data: String) {
  2. updateUserForm(id: $id, data: $data) {
  3. successMessage
  4. }
  5. }
👌 (1)
wmk

weird, the gatsby-source-silverstripe isn't installable with gatsby 2.17; had to require gatsby2.16

> error An unexpected error occurred: "could not find a copy of gatsby to link in D:\Users\<foo>\Documents\dev\<project>\site\docroot\gatsby\node_modules\gatsby-source-silverstripe\node_modules". is what I got before. Did I do anything wrong or are the module's settings a bit weird?