Skip to content

Commit

Permalink
backend: remove nodeId everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
tacone committed May 21, 2021
1 parent c461f53 commit 21efb6c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 90 deletions.
97 changes: 7 additions & 90 deletions backend/generated/schema.graphql
Original file line number Diff line number Diff line change
@@ -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."""
Expand All @@ -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!

Expand Down Expand Up @@ -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(
"""
Expand All @@ -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(
"""
Expand Down Expand Up @@ -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!
}

"""
Expand Down Expand Up @@ -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 {
"""
Expand All @@ -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 {
"""
Expand Down
2 changes: 2 additions & 0 deletions backend/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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", "*");
Expand Down Expand Up @@ -50,6 +51,7 @@ const options = {
],
simpleCollections: "only",
graphileBuildOptions: { pgOmitListSuffix: true },
skipPlugins: [NodePlugin],
};

// ====================== HTTP Server ======================
Expand Down

0 comments on commit 21efb6c

Please sign in to comment.