From 21efb6cf55c8fbd7f765ba23d6ab99eb3c6369df Mon Sep 17 00:00:00 2001 From: tacone Date: Fri, 21 May 2021 21:03:55 +0200 Subject: [PATCH] backend: remove nodeId everywhere --- backend/generated/schema.graphql | 97 +++----------------------------- backend/src/index.js | 2 + 2 files changed, 9 insertions(+), 90 deletions(-) diff --git a/backend/generated/schema.graphql b/backend/generated/schema.graphql index 13e39f3..d20c45c 100644 --- a/backend/generated/schema.graphql +++ b/backend/generated/schema.graphql @@ -1,22 +1,11 @@ """The root query type which gives access points into the data universe.""" -type Query implements Node { +type Query { """ Exposes the root query type nested one level down. This is helpful for Relay 1 which can only query top level fields if they are in a particular form. """ query: Query! - """ - The root query type must be a `Node` to work well with Relay 1 mutations. This just resolves to `query`. - """ - nodeId: ID! - - """Fetches an object given its globally unique `ID`.""" - node( - """The globally unique `ID`.""" - nodeId: ID! - ): Node - """Reads a set of `Submission`.""" submissions( """Only read the first `n` values of the set.""" @@ -40,31 +29,10 @@ type Query implements Node { ): [Submission!] submission(id: Int!): Submission submissionsStatistics: SubmissionsStatistic - - """Reads a single `Submission` using its globally unique `ID`.""" - submissionByNodeId( - """ - The globally unique `ID` to be used in selecting a single `Submission`. - """ - nodeId: ID! - ): Submission -} - -"""An object with a globally unique `ID`.""" -interface Node { - """ - A globally unique identifier. Can be used in various places throughout the system to identify this single value. - """ - nodeId: ID! } """A person's submission to the survey""" -type Submission implements Node { - """ - A globally unique identifier. Can be used in various places throughout the system to identify this single value. - """ - nodeId: ID! - +type Submission { """An unique incremental ID""" id: Int! @@ -466,16 +434,6 @@ type Mutation { input: CreateSubmissionInput! ): CreateSubmissionPayload - """ - Updates a single `Submission` using its globally unique id and a patch. - """ - updateSubmissionByNodeId( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: UpdateSubmissionByNodeIdInput! - ): UpdateSubmissionPayload - """Updates a single `Submission` using a unique key and a patch.""" updateSubmission( """ @@ -484,14 +442,6 @@ type Mutation { input: UpdateSubmissionInput! ): UpdateSubmissionPayload - """Deletes a single `Submission` using its globally unique id.""" - deleteSubmissionByNodeId( - """ - The exclusive input argument for this mutation. An object type, make sure to see documentation for this object’s fields. - """ - input: DeleteSubmissionByNodeIdInput! - ): DeleteSubmissionPayload - """Deletes a single `Submission` using a unique key.""" deleteSubmission( """ @@ -580,23 +530,21 @@ type UpdateSubmissionPayload { query: Query } -"""All input for the `updateSubmissionByNodeId` mutation.""" -input UpdateSubmissionByNodeIdInput { +"""All input for the `updateSubmission` mutation.""" +input UpdateSubmissionInput { """ An arbitrary string value with no semantic meaning. Will be included in the payload verbatim. May be used to track mutations by the client. """ clientMutationId: String - """ - The globally unique `ID` which will identify a single `Submission` to be updated. - """ - nodeId: ID! - """ An object where the defined keys will be set on the `Submission` being updated. """ patch: SubmissionPatch! + + """An unique incremental ID""" + id: Int! } """ @@ -634,23 +582,6 @@ input SubmissionPatch { createdAt: Date } -"""All input for the `updateSubmission` mutation.""" -input UpdateSubmissionInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String - - """ - An object where the defined keys will be set on the `Submission` being updated. - """ - patch: SubmissionPatch! - - """An unique incremental ID""" - id: Int! -} - """The output of our delete `Submission` mutation.""" type DeleteSubmissionPayload { """ @@ -669,20 +600,6 @@ type DeleteSubmissionPayload { query: Query } -"""All input for the `deleteSubmissionByNodeId` mutation.""" -input DeleteSubmissionByNodeIdInput { - """ - An arbitrary string value with no semantic meaning. Will be included in the - payload verbatim. May be used to track mutations by the client. - """ - clientMutationId: String - - """ - The globally unique `ID` which will identify a single `Submission` to be deleted. - """ - nodeId: ID! -} - """All input for the `deleteSubmission` mutation.""" input DeleteSubmissionInput { """ diff --git a/backend/src/index.js b/backend/src/index.js index 811072c..1f5f405 100644 --- a/backend/src/index.js +++ b/backend/src/index.js @@ -2,6 +2,7 @@ import simplifyInflector from "@graphile-contrib/pg-simplify-inflector"; import { postgraphile } from "postgraphile"; import connectionFilterPlugin from "postgraphile-plugin-connection-filter"; import { isListType } from "graphql"; +import {NodePlugin} from "graphile-build"; function allowCors(req, res, next) { res.setHeader("Access-Control-Allow-Origin", "*"); @@ -50,6 +51,7 @@ const options = { ], simpleCollections: "only", graphileBuildOptions: { pgOmitListSuffix: true }, + skipPlugins: [NodePlugin], }; // ====================== HTTP Server ======================