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
@@ -979,7 +979,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`."""
@@ -1571,7 +1571,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
 }
@@ -2041,7 +2041,7 @@
 """
 Represents an update to a `QuizEntryAnswer`. Fields that are set will be updated.
 """
-input QuizEntryAnswerPatch {
+input QuizEntryAnswerPatchSet {
   id: Int
   quizEntryId: Int
   question: String
@@ -2116,7 +2116,7 @@
 """
 Represents an update to a `QuizEntry`. Fields that are set will be updated.
 """
-input QuizEntryPatch {
+input QuizEntryPatchSet {
   id: Int
   userId: Int
   quizId: Int
@@ -2132,7 +2132,7 @@
 }
 
 """Represents an update to a `Quiz`. Fields that are set will be updated."""
-input QuizPatch {
+input QuizPatchSet {
   id: Int
   name: String
   updatedAt: Datetime
@@ -2315,7 +2315,7 @@
 """
 Represents an update to a `Topic`. Fields that are set will be updated.
 """
-input TopicPatch {
+input TopicPatchSet {
   id: Int
   forumId: Int
   authorId: Int
@@ -2392,7 +2392,7 @@
   """
   An object where the defined keys will be set on the `Forum` being updated.
   """
-  patch: ForumPatch!
+  patch: ForumPatchSet!
 }
 
 """All input for the `updateForumBySlug` mutation."""
@@ -2406,7 +2406,7 @@
   """
   An object where the defined keys will be set on the `Forum` being updated.
   """
-  patch: ForumPatch!
+  patch: ForumPatchSet!
 
   """An URL-safe alias for the `Forum`."""
   slug: String!
@@ -2423,7 +2423,7 @@
   """
   An object where the defined keys will be set on the `Forum` being updated.
   """
-  patch: ForumPatch!
+  patch: ForumPatchSet!
   id: Int!
 }
 
@@ -2466,7 +2466,7 @@
   """
   An object where the defined keys will be set on the `Post` being updated.
   """
-  patch: PostPatch!
+  patch: PostPatchSet!
 }
 
 """All input for the `updatePost` mutation."""
@@ -2480,7 +2480,7 @@
   """
   An object where the defined keys will be set on the `Post` being updated.
   """
-  patch: PostPatch!
+  patch: PostPatchSet!
   id: Int!
 }
 
@@ -2529,7 +2529,7 @@
   """
   An object where the defined keys will be set on the `Quiz` being updated.
   """
-  patch: QuizPatch!
+  patch: QuizPatchSet!
 }
 
 """All input for the `updateQuizEntryAnswerByNodeId` mutation."""
@@ -2548,7 +2548,7 @@
   """
   An object where the defined keys will be set on the `QuizEntryAnswer` being updated.
   """
-  patch: QuizEntryAnswerPatch!
+  patch: QuizEntryAnswerPatchSet!
 }
 
 """All input for the `updateQuizEntryAnswer` mutation."""
@@ -2562,7 +2562,7 @@
   """
   An object where the defined keys will be set on the `QuizEntryAnswer` being updated.
   """
-  patch: QuizEntryAnswerPatch!
+  patch: QuizEntryAnswerPatchSet!
   id: Int!
 }
 
@@ -2608,7 +2608,7 @@
   """
   An object where the defined keys will be set on the `QuizEntry` being updated.
   """
-  patch: QuizEntryPatch!
+  patch: QuizEntryPatchSet!
 }
 
 """All input for the `updateQuizEntry` mutation."""
@@ -2622,7 +2622,7 @@
   """
   An object where the defined keys will be set on the `QuizEntry` being updated.
   """
-  patch: QuizEntryPatch!
+  patch: QuizEntryPatchSet!
   id: Int!
 }
 
@@ -2666,7 +2666,7 @@
   """
   An object where the defined keys will be set on the `Quiz` being updated.
   """
-  patch: QuizPatch!
+  patch: QuizPatchSet!
   id: Int!
 }
 
@@ -2709,7 +2709,7 @@
   """
   An object where the defined keys will be set on the `Topic` being updated.
   """
-  patch: TopicPatch!
+  patch: TopicPatchSet!
 }
 
 """All input for the `updateTopic` mutation."""
@@ -2723,7 +2723,7 @@
   """
   An object where the defined keys will be set on the `Topic` being updated.
   """
-  patch: TopicPatch!
+  patch: TopicPatchSet!
   id: Int!
 }
 
@@ -2772,7 +2772,7 @@
   """
   An object where the defined keys will be set on the `UserAuthentication` being updated.
   """
-  patch: UserAuthenticationPatch!
+  patch: UserAuthenticationPatchSet!
 }
 
 """
@@ -2788,7 +2788,7 @@
   """
   An object where the defined keys will be set on the `UserAuthentication` being updated.
   """
-  patch: UserAuthenticationPatch!
+  patch: UserAuthenticationPatchSet!
 
   """The login service used, e.g. `twitter` or `github`."""
   service: String!
@@ -2808,7 +2808,7 @@
   """
   An object where the defined keys will be set on the `UserAuthentication` being updated.
   """
-  patch: UserAuthenticationPatch!
+  patch: UserAuthenticationPatchSet!
   id: Int!
 }
 
@@ -2851,7 +2851,7 @@
   """
   An object where the defined keys will be set on the `User` being updated.
   """
-  patch: UserPatch!
+  patch: UserPatchSet!
 }
 
 """All input for the `updateUserByUsername` mutation."""
@@ -2865,7 +2865,7 @@
   """
   An object where the defined keys will be set on the `User` being updated.
   """
-  patch: UserPatch!
+  patch: UserPatchSet!
 
   """Public-facing username (or 'handle') of the user."""
   username: String!
@@ -2887,7 +2887,7 @@
   """
   An object where the defined keys will be set on the `UserEmail` being updated.
   """
-  patch: UserEmailPatch!
+  patch: UserEmailPatchSet!
 }
 
 """All input for the `updateUserEmailByUserIdAndEmail` mutation."""
@@ -2901,7 +2901,7 @@
   """
   An object where the defined keys will be set on the `UserEmail` being updated.
   """
-  patch: UserEmailPatch!
+  patch: UserEmailPatchSet!
   userId: Int!
 
   """The users email address, in `[email protected]` format."""
@@ -2919,7 +2919,7 @@
   """
   An object where the defined keys will be set on the `UserEmail` being updated.
   """
-  patch: UserEmailPatch!
+  patch: UserEmailPatchSet!
   id: Int!
 }
 
@@ -2960,7 +2960,7 @@
   """
   An object where the defined keys will be set on the `User` being updated.
   """
-  patch: UserPatch!
+  patch: UserPatchSet!
 
   """Unique identifier for the user."""
   id: Int!
@@ -3165,7 +3165,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`."""
@@ -3271,7 +3271,7 @@
 """
 Represents an update to a `UserEmail`. Fields that are set will be updated.
 """
-input UserEmailPatch {
+input UserEmailPatchSet {
   id: Int
   userId: Int
 
@@ -3353,7 +3353,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