Skip to content

Commit

Permalink
[699] Only expose RepresentationMetadata in most of the GraphQL Schema
Browse files Browse the repository at this point in the history
In almost all locations where we used to return a full
Representation (or a concrete Diagram), only expose the new
RepresentationMetadata type. The only exception is in the
subscription, where we actually *need* the full representation's
content.

This ensures the underlying's representation content (e.g. the
nodes/edges/etc. on a diagram) can not be accessed by the frontend
except in the specific case where it is needed.

This change is purely on the GraphQL Schema level and does not change
anything to which Java objects are loaded/manipulated on the backend.
It just makes sure that except for the case of refresh events, only
the metadata fields can be requested by and returned to the frontend.

Bug: #699
Signed-off-by: Pierre-Charles David <[email protected]>
  • Loading branch information
pcdavid committed Sep 7, 2021
1 parent b4f838e commit 99a5ac6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ union DeleteFromDiagramPayload = ErrorPayload | DeleteFromDiagramSuccessPayload

type DeleteFromDiagramSuccessPayload {
id: ID!
diagram: Diagram!
diagram: RepresentationMetadata!
}

input EditLabelInput {
Expand All @@ -238,7 +238,7 @@ union EditLabelPayload = ErrorPayload|EditLabelSuccessPayload

type EditLabelSuccessPayload {
id: ID!
diagram: Diagram!
diagram: RepresentationMetadata!
}

input InvokeEdgeToolOnDiagramInput {
Expand All @@ -254,7 +254,7 @@ union InvokeEdgeToolOnDiagramPayload = ErrorPayload | InvokeEdgeToolOnDiagramSuc

type InvokeEdgeToolOnDiagramSuccessPayload {
id: ID!
diagram: Diagram!
diagram: RepresentationMetadata!
}

input InvokeNodeToolOnDiagramInput {
Expand All @@ -272,7 +272,7 @@ union InvokeNodeToolOnDiagramPayload = ErrorPayload | InvokeNodeToolOnDiagramSuc

type InvokeNodeToolOnDiagramSuccessPayload {
id: ID!
diagram: Diagram!
diagram: RepresentationMetadata!
}

input UpdateNodeBoundsInput {
Expand All @@ -290,7 +290,7 @@ union UpdateNodeBoundsPayload = ErrorPayload | UpdateNodeBoundsSuccessPayload

type UpdateNodeBoundsSuccessPayload {
id: ID!
diagram: Diagram!
diagram: RepresentationMetadata!
}

input UpdateNodePositionInput {
Expand All @@ -306,5 +306,5 @@ union UpdateNodePositionPayload = ErrorPayload | UpdateNodePositionSuccessPayloa

type UpdateNodePositionSuccessPayload {
id: ID!
diagram: Diagram!
diagram: RepresentationMetadata!
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface Viewer {
type EditingContext {
id: ID!
domains: [Domain!]!
representation(representationId: ID!): Representation
representation(representationId: ID!): RepresentationMetadata
representations: EditingContextRepresentationConnection!
representationDescriptions(classId: ID!): EditingContextRepresentationDescriptionConnection!
stereotypeDescriptions: EditingContextStereotypeDescriptionConnection!
Expand All @@ -28,6 +28,13 @@ type Domain {
label: String!
}

type RepresentationMetadata {
id: ID!
description: RepresentationDescription!
label: String!
kind: String!
}

interface Representation {
id: ID!
kind: String!
Expand Down Expand Up @@ -55,7 +62,7 @@ type EditingContextRepresentationConnection {
}

type EditingContextRepresentationEdge {
node: Representation!
node: RepresentationMetadata!
}

type EditingContextRepresentationDescriptionConnection {
Expand Down Expand Up @@ -91,7 +98,6 @@ type Diagnostic {
message: String!
}


type ErrorPayload {
id: ID!
message: String!
Expand Down Expand Up @@ -191,7 +197,7 @@ union CreateRepresentationPayload = ErrorPayload | CreateRepresentationSuccessPa

type CreateRepresentationSuccessPayload {
id: ID!
representation: Representation!
representation: RepresentationMetadata!
}

input CreateRootObjectInput {
Expand Down

0 comments on commit 99a5ac6

Please sign in to comment.