Below you'll find some small plugins that people have written. Larger plugins likely have their own dedicated repositories, these are typically just examples of how to achieve a small goal.

This is a work in progress, in future these plugins will be automatically tested but we've not got quite that far yet, so my apologies if you come across any issues.


  • Inflector
    • PgRenamePatchToPatchSetPlugin
    • PgShortenAllRowsInflectorPlugin
  • Types
  • Mutation wrappers
  • Customisation
/**
 * Simply renames the `UserPatch` and `PostPatch` type names to be called
 * `UserPatchSet` and `PostPatchSet` instead.
 *
 * Not particularly useful, just an example. ('PatchSet' chosen to minimise
 * diff to make example clearer.)
 *
 * Replaces this inflector:
 * https://github.com/graphile/graphile-engine/blob/f3fb3878692c6959e481e517375da66503428dc5/packages/graphile-build-pg/src/plugins/PgBasicsPlugin.js#L309-L311
 */
module.exports = function PgRenamePatchToPatchSetPlugin(
  builder
) {
  builder.hook(
    "inflection",
    inflector => ({
      // Retain the existing inflectors
      ...inflector,

      // Override the patchType inflector
      patchType(typeName) {
        // return this.upperCamelCase(`${typeName}-patch`);
        return this.upperCamelCase(
          `${typeName}-patch-set`
        );
      },
    })
  );
};
--- Original GraphQL Schema
+++ Modified GraphQL Schema
@@ -805,7 +805,7 @@
 }
 
 # Represents an update to a `Forum`. Fields that are set will be updated.
-input ForumPatch {
+input ForumPatchSet {
   id: Int
 
   # An URL-safe alias for the `Forum`.
@@ -1269,7 +1269,7 @@
 }
 
 # Represents an update to a `Post`. Fields that are set will be updated.
-input PostPatch {
+input PostPatchSet {
   # The body of the `Topic`, which Posts reply to.
   body: String
 }
@@ -1689,7 +1689,7 @@
 }
 
 # Represents an update to a `QuizEntryAnswer`. Fields that are set will be updated.
-input QuizEntryAnswerPatch {
+input QuizEntryAnswerPatchSet {
   id: Int
   quizEntryId: Int
   question: String
@@ -1756,7 +1756,7 @@
 }
 
 # Represents an update to a `QuizEntry`. Fields that are set will be updated.
-input QuizEntryPatch {
+input QuizEntryPatchSet {
   id: Int
   userId: Int
   quizId: Int
@@ -1772,7 +1772,7 @@
 }
 
 # Represents an update to a `Quiz`. Fields that are set will be updated.
-input QuizPatch {
+input QuizPatchSet {
   id: Int
   name: String
   updatedAt: Datetime
@@ -1937,7 +1937,7 @@
 }
 
 # Represents an update to a `Topic`. Fields that are set will be updated.
-input TopicPatch {
+input TopicPatchSet {
   id: Int
   forumId: Int
   authorId: Int
@@ -2003,7 +2003,7 @@
   clientMutationId: String
 
   # An object where the defined keys will be set on the `Forum` being updated.
-  forumPatch: ForumPatch!
+  forumPatch: ForumPatchSet!
   id: Int!
 }
 
@@ -2014,7 +2014,7 @@
   clientMutationId: String
 
   # An object where the defined keys will be set on the `Forum` being updated.
-  forumPatch: ForumPatch!
+  forumPatch: ForumPatchSet!
 
   # An URL-safe alias for the `Forum`.
   slug: String!
@@ -2030,7 +2030,7 @@
   nodeId: ID!
 
   # An object where the defined keys will be set on the `Forum` being updated.
-  forumPatch: ForumPatch!
+  forumPatch: ForumPatchSet!
 }
 
 # The output of our update `Forum` mutation.
@@ -2059,7 +2059,7 @@
   clientMutationId: String
 
   # An object where the defined keys will be set on the `Post` being updated.
-  postPatch: PostPatch!
+  postPatch: PostPatchSet!
   id: Int!
 }
 
@@ -2073,7 +2073,7 @@
   nodeId: ID!
 
   # An object where the defined keys will be set on the `Post` being updated.
-  postPatch: PostPatch!
+  postPatch: PostPatchSet!
 }
 
 # The output of our update `Post` mutation.
@@ -2108,7 +2108,7 @@
   clientMutationId: String
 
   # An object where the defined keys will be set on the `Quiz` being updated.
-  quizPatch: QuizPatch!
+  quizPatch: QuizPatchSet!
   id: Int!
 }
 
@@ -2119,7 +2119,7 @@
   clientMutationId: String
 
   # An object where the defined keys will be set on the `QuizEntryAnswer` being updated.
-  quizEntryAnswerPatch: QuizEntryAnswerPatch!
+  quizEntryAnswerPatch: QuizEntryAnswerPatchSet!
   id: Int!
 }
 
@@ -2133,7 +2133,7 @@
   nodeId: ID!
 
   # An object where the defined keys will be set on the `QuizEntryAnswer` being updated.
-  quizEntryAnswerPatch: QuizEntryAnswerPatch!
+  quizEntryAnswerPatch: QuizEntryAnswerPatchSet!
 }
 
 # The output of our update `QuizEntryAnswer` mutation.
@@ -2165,7 +2165,7 @@
   clientMutationId: String
 
   # An object where the defined keys will be set on the `QuizEntry` being updated.
-  quizEntryPatch: QuizEntryPatch!
+  quizEntryPatch: QuizEntryPatchSet!
   id: Int!
 }
 
@@ -2179,7 +2179,7 @@
   nodeId: ID!
 
   # An object where the defined keys will be set on the `QuizEntry` being updated.
-  quizEntryPatch: QuizEntryPatch!
+  quizEntryPatch: QuizEntryPatchSet!
 }
 
 # The output of our update `QuizEntry` mutation.
@@ -2217,7 +2217,7 @@
   nodeId: ID!
 
   # An object where the defined keys will be set on the `Quiz` being updated.
-  quizPatch: QuizPatch!
+  quizPatch: QuizPatchSet!
 }
 
 # The output of our update `Quiz` mutation.
@@ -2246,7 +2246,7 @@
   clientMutationId: String
 
   # An object where the defined keys will be set on the `Topic` being updated.
-  topicPatch: TopicPatch!
+  topicPatch: TopicPatchSet!
   id: Int!
 }
 
@@ -2260,7 +2260,7 @@
   nodeId: ID!
 
   # An object where the defined keys will be set on the `Topic` being updated.
-  topicPatch: TopicPatch!
+  topicPatch: TopicPatchSet!
 }
 
 # The output of our update `Topic` mutation.
@@ -2295,7 +2295,7 @@
   clientMutationId: String
 
   # An object where the defined keys will be set on the `UserAuthentication` being updated.
-  userAuthenticationPatch: UserAuthenticationPatch!
+  userAuthenticationPatch: UserAuthenticationPatchSet!
   id: Int!
 }
 
@@ -2306,7 +2306,7 @@
   clientMutationId: String
 
   # An object where the defined keys will be set on the `UserAuthentication` being updated.
-  userAuthenticationPatch: UserAuthenticationPatch!
+  userAuthenticationPatch: UserAuthenticationPatchSet!
 
   # The login service used, e.g. `twitter` or `github`.
   service: String!
@@ -2325,7 +2325,7 @@
   nodeId: ID!
 
   # An object where the defined keys will be set on the `UserAuthentication` being updated.
-  userAuthenticationPatch: UserAuthenticationPatch!
+  userAuthenticationPatch: UserAuthenticationPatchSet!
 }
 
 # The output of our update `UserAuthentication` mutation.
@@ -2354,7 +2354,7 @@
   clientMutationId: String
 
   # An object where the defined keys will be set on the `User` being updated.
-  userPatch: UserPatch!
+  userPatch: UserPatchSet!
 
   # Unique identifier for the user.
   id: Int!
@@ -2367,7 +2367,7 @@
   clientMutationId: String
 
   # An object where the defined keys will be set on the `User` being updated.
-  userPatch: UserPatch!
+  userPatch: UserPatchSet!
 
   # Public-facing username (or 'handle') of the user.
   username: String!
@@ -2380,7 +2380,7 @@
   clientMutationId: String
 
   # An object where the defined keys will be set on the `UserEmail` being updated.
-  userEmailPatch: UserEmailPatch!
+  userEmailPatch: UserEmailPatchSet!
   id: Int!
 }
 
@@ -2391,7 +2391,7 @@
   clientMutationId: String
 
   # An object where the defined keys will be set on the `UserEmail` being updated.
-  userEmailPatch: UserEmailPatch!
+  userEmailPatch: UserEmailPatchSet!
   userId: Int!
 
   # The users email address, in `[email protected]` format.
@@ -2408,7 +2408,7 @@
   nodeId: ID!
 
   # An object where the defined keys will be set on the `UserEmail` being updated.
-  userEmailPatch: UserEmailPatch!
+  userEmailPatch: UserEmailPatchSet!
 }
 
 # The output of our update `UserEmail` mutation.
@@ -2443,7 +2443,7 @@
   nodeId: ID!
 
   # An object where the defined keys will be set on the `User` being updated.
-  userPatch: UserPatch!
+  userPatch: UserPatchSet!
 }
 
 # The output of our update `User` mutation.
@@ -2617,7 +2617,7 @@
 }
 
 # Represents an update to a `UserAuthentication`. Fields that are set will be updated.
-input UserAuthenticationPatch {
+input UserAuthenticationPatchSet {
   id: Int
 
   # The login service used, e.g. `twitter` or `github`.
@@ -2713,7 +2713,7 @@
 }
 
 # Represents an update to a `UserEmail`. Fields that are set will be updated.
-input UserEmailPatch {
+input UserEmailPatchSet {
   id: Int
   userId: Int
 
@@ -2791,7 +2791,7 @@
 }
 
 # Represents an update to a `User`. Fields that are set will be updated.
-input UserPatch {
+input UserPatchSet {
   # Unique identifier for the user.
   id: Int