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`."""
@@ -1577,7 +1577,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
 }
@@ -2051,7 +2051,7 @@
 """
 Represents an update to a `QuizEntryAnswer`. Fields that are set will be updated.
 """
-input QuizEntryAnswerPatch {
+input QuizEntryAnswerPatchSet {
   id: Int
   quizEntryId: Int
   question: String
@@ -2126,7 +2126,7 @@
 """
 Represents an update to a `QuizEntry`. Fields that are set will be updated.
 """
-input QuizEntryPatch {
+input QuizEntryPatchSet {
   id: Int
   userId: Int
   quizId: Int
@@ -2144,7 +2144,7 @@
 """
 Represents an update to a `Quiz`. Fields that are set will be updated.
 """
-input QuizPatch {
+input QuizPatchSet {
   id: Int
   name: String
   updatedAt: Datetime
@@ -2327,7 +2327,7 @@
 """
 Represents an update to a `Topic`. Fields that are set will be updated.
 """
-input TopicPatch {
+input TopicPatchSet {
   id: Int
   forumId: Int
   authorId: Int
@@ -2399,7 +2399,7 @@
   """
   An object where the defined keys will be set on the `Forum` being updated.
   """
-  patch: ForumPatch!
+  patch: ForumPatchSet!
   id: Int!
 }
 
@@ -2414,7 +2414,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!
@@ -2436,7 +2436,7 @@
   """
   An object where the defined keys will be set on the `Forum` being updated.
   """
-  patch: ForumPatch!
+  patch: ForumPatchSet!
 }
 
 """The output of our update `Forum` mutation."""
@@ -2473,7 +2473,7 @@
   """
   An object where the defined keys will be set on the `Post` being updated.
   """
-  patch: PostPatch!
+  patch: PostPatchSet!
   id: Int!
 }
 
@@ -2493,7 +2493,7 @@
   """
   An object where the defined keys will be set on the `Post` being updated.
   """
-  patch: PostPatch!
+  patch: PostPatchSet!
 }
 
 """The output of our update `Post` mutation."""
@@ -2536,7 +2536,7 @@
   """
   An object where the defined keys will be set on the `Quiz` being updated.
   """
-  patch: QuizPatch!
+  patch: QuizPatchSet!
   id: Int!
 }
 
@@ -2551,7 +2551,7 @@
   """
   An object where the defined keys will be set on the `QuizEntryAnswer` being updated.
   """
-  patch: QuizEntryAnswerPatch!
+  patch: QuizEntryAnswerPatchSet!
   id: Int!
 }
 
@@ -2571,7 +2571,7 @@
   """
   An object where the defined keys will be set on the `QuizEntryAnswer` being updated.
   """
-  patch: QuizEntryAnswerPatch!
+  patch: QuizEntryAnswerPatchSet!
 }
 
 """The output of our update `QuizEntryAnswer` mutation."""
@@ -2611,7 +2611,7 @@
   """
   An object where the defined keys will be set on the `QuizEntry` being updated.
   """
-  patch: QuizEntryPatch!
+  patch: QuizEntryPatchSet!
   id: Int!
 }
 
@@ -2631,7 +2631,7 @@
   """
   An object where the defined keys will be set on the `QuizEntry` being updated.
   """
-  patch: QuizEntryPatch!
+  patch: QuizEntryPatchSet!
 }
 
 """The output of our update `QuizEntry` mutation."""
@@ -2679,7 +2679,7 @@
   """
   An object where the defined keys will be set on the `Quiz` being updated.
   """
-  patch: QuizPatch!
+  patch: QuizPatchSet!
 }
 
 """The output of our update `Quiz` mutation."""
@@ -2716,7 +2716,7 @@
   """
   An object where the defined keys will be set on the `Topic` being updated.
   """
-  patch: TopicPatch!
+  patch: TopicPatchSet!
   id: Int!
 }
 
@@ -2736,7 +2736,7 @@
   """
   An object where the defined keys will be set on the `Topic` being updated.
   """
-  patch: TopicPatch!
+  patch: TopicPatchSet!
 }
 
 """The output of our update `Topic` mutation."""
@@ -2779,7 +2779,7 @@
   """
   An object where the defined keys will be set on the `UserAuthentication` being updated.
   """
-  patch: UserAuthenticationPatch!
+  patch: UserAuthenticationPatchSet!
   id: Int!
 }
 
@@ -2796,7 +2796,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!
@@ -2821,7 +2821,7 @@
   """
   An object where the defined keys will be set on the `UserAuthentication` being updated.
   """
-  patch: UserAuthenticationPatch!
+  patch: UserAuthenticationPatchSet!
 }
 
 """The output of our update `UserAuthentication` mutation."""
@@ -2858,7 +2858,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!
@@ -2875,7 +2875,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!
@@ -2892,7 +2892,7 @@
   """
   An object where the defined keys will be set on the `UserEmail` being updated.
   """
-  patch: UserEmailPatch!
+  patch: UserEmailPatchSet!
   id: Int!
 }
 
@@ -2907,7 +2907,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."""
@@ -2930,7 +2930,7 @@
   """
   An object where the defined keys will be set on the `UserEmail` being updated.
   """
-  patch: UserEmailPatch!
+  patch: UserEmailPatchSet!
 }
 
 """The output of our update `UserEmail` mutation."""
@@ -2975,7 +2975,7 @@
   """
   An object where the defined keys will be set on the `User` being updated.
   """
-  patch: UserPatch!
+  patch: UserPatchSet!
 }
 
 """The output of our update `User` mutation."""
@@ -3177,7 +3177,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`."""
@@ -3283,7 +3283,7 @@
 """
 Represents an update to a `UserEmail`. Fields that are set will be updated.
 """
-input UserEmailPatch {
+input UserEmailPatchSet {
   id: Int
   userId: Int
 
@@ -3367,7 +3367,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