Graphql Code Generator logo

React Form Plugin

Road Map To Release

follow @ericwooley for updates

Simple user Create

Graphql Mutation Source
mutation addUser($email: String!, $name: String!, $password: String) {
  addUser(
    user: { friends: [], email: $email, name: $name, password: $password }
  ) {
    id
  }
}


Options

Generated Form

Email must be a valid email

Password must be 8 characters, have 1 number, 1 capital, and 1 symbol

Form Result

Submit the form to see the result

Graphql Mutation Source
mutation addUsersFromList($users: [UserInput]!) {
  addUsers(users: $users) {
    id
  }
}

query users {
  allUsers {
    id
  }
}


Options

Generated Form

Users

Form Result

Submit the form to see the result

Graphql Mutation Source
mutation addUserFromObject($user: UserInput!) {
  addUser(user: $user) {
    id
  }
}


Options

Generated Form

Name must be at least 2 characters.

Must be a valid email

Friends

Followers

Form Result

Submit the form to see the result

Graphql Schema
type User {
  id: Int!
  name: String!
  password: String
  email: String!
  friends: [User]!
}

input UserInput {
  id: Int
  name: String!
  email: String!
  password: String
  mother: UserInput
  father: UserInput
  friends: [UserInput]!
  followers: [UserInput]
}

type QueryRoot {
  allUsers: [User]!
  userById(id: Int!): User

  # Generates a new answer for the guessing game
  answer: [Int!]!
}
type MutationRoot {
  addUsers(users: [UserInput]!): [User]
  addUser(user: UserInput!): User
}

type SubscriptionRoot {
  newUser: User
}

schema {
  query: QueryRoot
  subscription: SubscriptionRoot
  mutation: MutationRoot
}