Introduce viewer object

Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
gearnode
2025-02-25 15:23:29 +01:00
parent 42fec1bc71
commit 49c3807b4f
20 changed files with 1373 additions and 903 deletions

View File

@@ -0,0 +1,8 @@
LIVE_RELOAD=
POSTHOG_HOST=
POSTHOG_KEY=
FARO_PUSH_URL=
API_SERVER_HOST="http://localhost:8080"

View File

@@ -58,7 +58,7 @@ const staticData = {
url: "/vendors", url: "/vendors",
icon: ToyBrick, icon: ToyBrick,
}, },
] ],
}, },
{ {
title: "Settings", title: "Settings",
@@ -82,9 +82,9 @@ const staticData = {
const AppSidebarQuery = graphql` const AppSidebarQuery = graphql`
query AppSidebarQuery { query AppSidebarQuery {
node(id: "AZSfP_xAcAC5IAAAAAAltA") { viewer {
id id
... on Organization { organization {
name name
logoUrl logoUrl
createdAt createdAt
@@ -101,7 +101,7 @@ function AppSidebarContent({
queryRef: PreloadedQuery<AppSidebarQueryType>; queryRef: PreloadedQuery<AppSidebarQueryType>;
}) { }) {
const data = usePreloadedQuery(AppSidebarQuery, queryRef); const data = usePreloadedQuery(AppSidebarQuery, queryRef);
const organization = data.node; const organization = data.viewer.organization;
return ( return (
<Sidebar variant="inset" {...props}> <Sidebar variant="inset" {...props}>

View File

@@ -1,5 +1,5 @@
/** /**
* @generated SignedSource<<c76b330caf722464b0da18ad8a5f058a>> * @generated SignedSource<<578d66fa0d0065452d9fa64611b7cfda>>
* @lightSyntaxTransform * @lightSyntaxTransform
* @nogrep * @nogrep
*/ */
@@ -11,12 +11,14 @@
import { ConcreteRequest } from 'relay-runtime'; import { ConcreteRequest } from 'relay-runtime';
export type AppSidebarQuery$variables = Record<PropertyKey, never>; export type AppSidebarQuery$variables = Record<PropertyKey, never>;
export type AppSidebarQuery$data = { export type AppSidebarQuery$data = {
readonly node: { readonly viewer: {
readonly createdAt?: any;
readonly id: string; readonly id: string;
readonly logoUrl?: string; readonly organization: {
readonly name?: string; readonly createdAt: any;
readonly updatedAt?: any; readonly logoUrl: string;
readonly name: string;
readonly updatedAt: any;
};
}; };
}; };
export type AppSidebarQuery = { export type AppSidebarQuery = {
@@ -25,54 +27,40 @@ export type AppSidebarQuery = {
}; };
const node: ConcreteRequest = (function(){ const node: ConcreteRequest = (function(){
var v0 = [ var v0 = {
{
"kind": "Literal",
"name": "id",
"value": "AZSfP_xAcAC5IAAAAAAltA"
}
],
v1 = {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "id", "name": "id",
"storageKey": null "storageKey": null
}, },
v2 = { v1 = {
"kind": "InlineFragment",
"selections": [
{
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "name", "name": "name",
"storageKey": null "storageKey": null
}, },
{ v2 = {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "logoUrl", "name": "logoUrl",
"storageKey": null "storageKey": null
}, },
{ v3 = {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "createdAt", "name": "createdAt",
"storageKey": null "storageKey": null
}, },
{ v4 = {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "updatedAt", "name": "updatedAt",
"storageKey": null "storageKey": null
}
],
"type": "Organization",
"abstractKey": null
}; };
return { return {
"fragment": { "fragment": {
@@ -83,16 +71,30 @@ return {
"selections": [ "selections": [
{ {
"alias": null, "alias": null,
"args": (v0/*: any*/), "args": null,
"concreteType": null, "concreteType": "Viewer",
"kind": "LinkedField", "kind": "LinkedField",
"name": "node", "name": "viewer",
"plural": false,
"selections": [
(v0/*: any*/),
{
"alias": null,
"args": null,
"concreteType": "Organization",
"kind": "LinkedField",
"name": "organization",
"plural": false, "plural": false,
"selections": [ "selections": [
(v1/*: any*/), (v1/*: any*/),
(v2/*: any*/) (v2/*: any*/),
(v3/*: any*/),
(v4/*: any*/)
], ],
"storageKey": "node(id:\"AZSfP_xAcAC5IAAAAAAltA\")" "storageKey": null
}
],
"storageKey": null
} }
], ],
"type": "Query", "type": "Query",
@@ -106,37 +108,45 @@ return {
"selections": [ "selections": [
{ {
"alias": null, "alias": null,
"args": (v0/*: any*/), "args": null,
"concreteType": null, "concreteType": "Viewer",
"kind": "LinkedField", "kind": "LinkedField",
"name": "node", "name": "viewer",
"plural": false, "plural": false,
"selections": [ "selections": [
(v0/*: any*/),
{ {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "concreteType": "Organization",
"name": "__typename", "kind": "LinkedField",
"storageKey": null "name": "organization",
}, "plural": false,
"selections": [
(v1/*: any*/), (v1/*: any*/),
(v2/*: any*/) (v2/*: any*/),
(v3/*: any*/),
(v4/*: any*/),
(v0/*: any*/)
], ],
"storageKey": "node(id:\"AZSfP_xAcAC5IAAAAAAltA\")" "storageKey": null
}
],
"storageKey": null
} }
] ]
}, },
"params": { "params": {
"cacheID": "c5135cf2fd79365dad2ea581b3e010de", "cacheID": "e50b9b44daf91d53b07f8912e6c2088f",
"id": null, "id": null,
"metadata": {}, "metadata": {},
"name": "AppSidebarQuery", "name": "AppSidebarQuery",
"operationKind": "query", "operationKind": "query",
"text": "query AppSidebarQuery {\n node(id: \"AZSfP_xAcAC5IAAAAAAltA\") {\n __typename\n id\n ... on Organization {\n name\n logoUrl\n createdAt\n updatedAt\n }\n }\n}\n" "text": "query AppSidebarQuery {\n viewer {\n id\n organization {\n name\n logoUrl\n createdAt\n updatedAt\n id\n }\n }\n}\n"
} }
}; };
})(); })();
(node as any).hash = "2aafa67cfe2e2c748605b224503c7463"; (node as any).hash = "d450e65862def2f7ebd6f4b8d0475be0";
export default node; export default node;

View File

@@ -73,7 +73,7 @@ function BreadcrumbFrameworkOverview() {
} }
`, `,
{ frameworkId: frameworkId! }, { frameworkId: frameworkId! },
{ fetchPolicy: "store-or-network" }, { fetchPolicy: "store-or-network" }
); );
return ( return (
@@ -133,7 +133,7 @@ function BreadcrumbPeopleOverview() {
} }
`, `,
{ peopleId: peopleId! }, { peopleId: peopleId! },
{ fetchPolicy: "store-or-network" }, { fetchPolicy: "store-or-network" }
); );
return ( return (
@@ -177,7 +177,7 @@ function BreadcrumbVendorOverview() {
} }
`, `,
{ vendorId: vendorId! }, { vendorId: vendorId! },
{ fetchPolicy: "store-or-network" }, { fetchPolicy: "store-or-network" }
); );
return ( return (
@@ -215,7 +215,7 @@ function BreadcrumbControlOverview() {
} }
`, `,
{ frameworkId: frameworkId!, controlId: controlId! }, { frameworkId: frameworkId!, controlId: controlId! },
{ fetchPolicy: "store-or-network" }, { fetchPolicy: "store-or-network" }
); );
return ( return (

View File

@@ -22,9 +22,11 @@ import { CreatePeoplePageCreatePeopleMutation } from "./__generated__/CreatePeop
const createPeoplePageQuery = graphql` const createPeoplePageQuery = graphql`
query CreatePeoplePageQuery { query CreatePeoplePageQuery {
currentOrganization: node(id: "AZSfP_xAcAC5IAAAAAAltA") { viewer {
id
organization {
id id
... on Organization {
name name
} }
} }
@@ -111,15 +113,15 @@ function CreatePeoplePageContent({
const handleSubmit = (e: React.FormEvent) => { const handleSubmit = (e: React.FormEvent) => {
e.preventDefault(); e.preventDefault();
const peopleConnectionId = ConnectionHandler.getConnectionID( const peopleConnectionId = ConnectionHandler.getConnectionID(
data.currentOrganization.id, data.viewer.organization.id,
"PeopleListPage_peoples", "PeopleListPage_peoples"
); );
createPeople({ createPeople({
variables: { variables: {
connections: [peopleConnectionId], connections: [peopleConnectionId],
input: { input: {
organizationId: data.currentOrganization.id, organizationId: data.viewer.organization.id,
fullName: formData.fullName, fullName: formData.fullName,
primaryEmailAddress: formData.primaryEmailAddress, primaryEmailAddress: formData.primaryEmailAddress,
additionalEmailAddresses: formData.additionalEmailAddresses, additionalEmailAddresses: formData.additionalEmailAddresses,
@@ -188,7 +190,7 @@ function CreatePeoplePageContent({
newEmails[index] = e.target.value; newEmails[index] = e.target.value;
handleFieldChange( handleFieldChange(
"additionalEmailAddresses", "additionalEmailAddresses",
newEmails, newEmails
); );
}} }}
/> />
@@ -198,11 +200,11 @@ function CreatePeoplePageContent({
onClick={() => { onClick={() => {
const newEmails = const newEmails =
formData.additionalEmailAddresses.filter( formData.additionalEmailAddresses.filter(
(_, i) => i !== index, (_, i) => i !== index
); );
handleFieldChange( handleFieldChange(
"additionalEmailAddresses", "additionalEmailAddresses",
newEmails, newEmails
); );
}} }}
> >
@@ -250,7 +252,7 @@ function CreatePeoplePageContent({
"rounded-full px-4 py-1 text-sm transition-colors", "rounded-full px-4 py-1 text-sm transition-colors",
formData.kind === "EMPLOYEE" formData.kind === "EMPLOYEE"
? "bg-blue-100 text-blue-900 ring-2 ring-blue-600 ring-offset-2" ? "bg-blue-100 text-blue-900 ring-2 ring-blue-600 ring-offset-2"
: "bg-gray-100 text-gray-900 hover:bg-gray-200", : "bg-gray-100 text-gray-900 hover:bg-gray-200"
)} )}
> >
Employee Employee
@@ -262,7 +264,7 @@ function CreatePeoplePageContent({
"rounded-full px-4 py-1 text-sm transition-colors", "rounded-full px-4 py-1 text-sm transition-colors",
formData.kind === "CONTRACTOR" formData.kind === "CONTRACTOR"
? "bg-purple-100 text-purple-900 ring-2 ring-purple-600 ring-offset-2" ? "bg-purple-100 text-purple-900 ring-2 ring-purple-600 ring-offset-2"
: "bg-gray-100 text-gray-900 hover:bg-gray-200", : "bg-gray-100 text-gray-900 hover:bg-gray-200"
)} )}
> >
Contractor Contractor
@@ -292,7 +294,7 @@ function CreatePeoplePageContent({
export default function CreatePeoplePage() { export default function CreatePeoplePage() {
const [queryRef, loadQuery] = useQueryLoader<CreatePeoplePageQueryType>( const [queryRef, loadQuery] = useQueryLoader<CreatePeoplePageQueryType>(
createPeoplePageQuery, createPeoplePageQuery
); );
useEffect(() => { useEffect(() => {

View File

@@ -9,16 +9,12 @@ import { Card, CardContent } from "@/components/ui/card";
import { Link } from "react-router"; import { Link } from "react-router";
import type { FrameworkListPageQuery as FrameworkListPageQueryType } from "./__generated__/FrameworkListPageQuery.graphql"; import type { FrameworkListPageQuery as FrameworkListPageQueryType } from "./__generated__/FrameworkListPageQuery.graphql";
import { Helmet } from "react-helmet-async"; import { Helmet } from "react-helmet-async";
import { Button } from "@/components/ui/button";
import { Badge } from "@/components/ui/badge";
import { ChevronRight } from "lucide-react";
import { Shield } from "lucide-react";
const FrameworkListPageQuery = graphql` const FrameworkListPageQuery = graphql`
query FrameworkListPageQuery { query FrameworkListPageQuery {
node(id: "AZSfP_xAcAC5IAAAAAAltA") { viewer {
id id
... on Organization { organization {
frameworks { frameworks {
edges { edges {
node { node {
@@ -91,7 +87,7 @@ function FrameworkListPageContent({
}) { }) {
const data = usePreloadedQuery(FrameworkListPageQuery, queryRef); const data = usePreloadedQuery(FrameworkListPageQuery, queryRef);
const frameworks = const frameworks =
data.node.frameworks?.edges.map((edge) => edge?.node) ?? []; data.viewer.organization.frameworks?.edges.map((edge) => edge?.node) ?? [];
return ( return (
<div className="space-y-6"> <div className="space-y-6">
@@ -105,7 +101,7 @@ function FrameworkListPageContent({
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-2"> <div className="grid gap-4 md:grid-cols-2 lg:grid-cols-2">
{frameworks.map((framework) => { {frameworks.map((framework) => {
const validatedControls = framework.controls.edges.filter( const validatedControls = framework.controls.edges.filter(
(edge) => edge?.node?.state === "IMPLEMENTED", (edge) => edge?.node?.state === "IMPLEMENTED"
).length; ).length;
const totalControls = framework.controls.edges.length; const totalControls = framework.controls.edges.length;
@@ -165,7 +161,7 @@ function FrameworkListPageFallback() {
export default function FrameworkListPage() { export default function FrameworkListPage() {
const [queryRef, loadQuery] = useQueryLoader<FrameworkListPageQueryType>( const [queryRef, loadQuery] = useQueryLoader<FrameworkListPageQueryType>(
FrameworkListPageQuery, FrameworkListPageQuery
); );
useEffect(() => { useEffect(() => {

View File

@@ -10,9 +10,9 @@ import type { HomePageQuery as HomePageQueryType } from "./__generated__/HomePag
export const HomePageQuery = graphql` export const HomePageQuery = graphql`
query HomePageQuery { query HomePageQuery {
node(id: "AZSfP_xAcAC5IAAAAAAltA") { viewer {
id id
... on Organization { organization {
name name
createdAt createdAt
updatedAt updatedAt

View File

@@ -28,9 +28,9 @@ const peopleListPageQuery = graphql`
$last: Int $last: Int
$before: CursorKey $before: CursorKey
) { ) {
currentOrganization: node(id: "AZSfP_xAcAC5IAAAAAAltA") { viewer {
id id
... on Organization { organization {
...PeopleListPage_peoples ...PeopleListPage_peoples
} }
} }
@@ -129,7 +129,7 @@ function PeopleListContent({
}) { }) {
const data = usePreloadedQuery<PeopleListPageQueryType>( const data = usePreloadedQuery<PeopleListPageQueryType>(
peopleListPageQuery, peopleListPageQuery,
queryRef, queryRef
); );
const [searchParams, setSearchParams] = useSearchParams(); const [searchParams, setSearchParams] = useSearchParams();
const [isPending, startTransition] = useTransition(); const [isPending, startTransition] = useTransition();
@@ -147,7 +147,7 @@ function PeopleListContent({
} = usePaginationFragment< } = usePaginationFragment<
PeopleListPagePaginationQuery, PeopleListPagePaginationQuery,
PeopleListPage_peoples$key PeopleListPage_peoples$key
>(peopleListFragment, data.currentOrganization); >(peopleListFragment, data.viewer.organization);
const peoples = const peoples =
peoplesConnection.peoples.edges.map((edge) => edge.node) ?? []; peoplesConnection.peoples.edges.map((edge) => edge.node) ?? [];
@@ -158,13 +158,19 @@ function PeopleListContent({
<div> <div>
<h2 className="text-2xl font-semibold mb-1">Employees</h2> <h2 className="text-2xl font-semibold mb-1">Employees</h2>
<p className="text-muted-foreground"> <p className="text-muted-foreground">
Keep track of your company's workforce and their progress towards completing tasks assigned to them. Keep track of your company's workforce and their progress towards
completing tasks assigned to them.
</p> </p>
</div> </div>
<div className="flex items-center justify-between"> <div className="flex items-center justify-between">
<p className="text-muted-foreground">1 people needs to get onboarded</p> <p className="text-muted-foreground">1 people needs to get onboarded</p>
<Button asChild variant="outline" style={{borderRadius: "0.5rem"}} className="gap-2"> <Button
asChild
variant="outline"
style={{ borderRadius: "0.5rem" }}
className="gap-2"
>
<Link to="/peoples/create"> <Link to="/peoples/create">
<UserPlus className="h-4 w-4" /> <UserPlus className="h-4 w-4" />
Add a people Add a people
@@ -213,7 +219,11 @@ function PeopleListContent({
className="h-8 w-8 text-muted-foreground hover:bg-transparent [&>svg]:hover:text-destructive" className="h-8 w-8 text-muted-foreground hover:bg-transparent [&>svg]:hover:text-destructive"
onClick={(e) => { onClick={(e) => {
e.preventDefault(); e.preventDefault();
if (window.confirm("Are you sure you want to delete this person?")) { if (
window.confirm(
"Are you sure you want to delete this person?"
)
) {
deletePeople({ deletePeople({
variables: { variables: {
connections: [peoplesConnection.peoples.__id], connections: [peoplesConnection.peoples.__id],

View File

@@ -26,9 +26,9 @@ import type { SettingsPageQuery as SettingsPageQueryType } from "./__generated__
const settingsPageQuery = graphql` const settingsPageQuery = graphql`
query SettingsPageQuery { query SettingsPageQuery {
node(id: "AZSfP_xAcAC5IAAAAAAltA") { viewer {
id id
... on Organization { organization {
name name
logoUrl logoUrl
} }
@@ -49,7 +49,7 @@ function SettingsPageContent({
queryRef: PreloadedQuery<SettingsPageQueryType>; queryRef: PreloadedQuery<SettingsPageQueryType>;
}) { }) {
const data = usePreloadedQuery(settingsPageQuery, queryRef); const data = usePreloadedQuery(settingsPageQuery, queryRef);
const organization = data.node; const organization = data.viewer.organization;
const members: Member[] = []; const members: Member[] = [];
return ( return (

View File

@@ -10,7 +10,7 @@ import {
import { useSearchParams } from "react-router"; import { useSearchParams } from "react-router";
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
import { Badge } from "@/components/ui/badge"; import { Badge } from "@/components/ui/badge";
import { CircleUser, Globe, Shield, Store, ChevronRight, Trash2 } from "lucide-react"; import { Store, ChevronRight, Trash2 } from "lucide-react";
import { Input } from "@/components/ui/input"; import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button"; import { Button } from "@/components/ui/button";
import { Link } from "react-router"; import { Link } from "react-router";
@@ -32,9 +32,9 @@ const vendorListPageQuery = graphql`
$last: Int $last: Int
$before: CursorKey $before: CursorKey
) { ) {
currentOrganization: node(id: "AZSfP_xAcAC5IAAAAAAltA") { viewer {
id id
... on Organization { organization {
...VendorListPage_vendors ...VendorListPage_vendors
} }
} }
@@ -174,7 +174,7 @@ function VendorListContent({
}) { }) {
const data = usePreloadedQuery<VendorListPageQueryType>( const data = usePreloadedQuery<VendorListPageQueryType>(
vendorListPageQuery, vendorListPageQuery,
queryRef, queryRef
); );
const [searchParams, setSearchParams] = useSearchParams(); const [searchParams, setSearchParams] = useSearchParams();
const [isPending, startTransition] = useTransition(); const [isPending, startTransition] = useTransition();
@@ -196,7 +196,7 @@ function VendorListContent({
} = usePaginationFragment< } = usePaginationFragment<
VendorListPagePaginationQuery, VendorListPagePaginationQuery,
VendorListPage_vendors$key VendorListPage_vendors$key
>(vendorListFragment, data.currentOrganization); >(vendorListFragment, data.viewer.organization);
const vendors = const vendors =
vendorsConnection.vendors.edges.map((edge) => edge.node) ?? []; vendorsConnection.vendors.edges.map((edge) => edge.node) ?? [];
@@ -212,7 +212,8 @@ function VendorListContent({
<div> <div>
<h2 className="text-2xl font-semibold mb-1">Vendors</h2> <h2 className="text-2xl font-semibold mb-1">Vendors</h2>
<p className="text-muted-foreground"> <p className="text-muted-foreground">
Vendors are third-party services that your company uses. Add them to keep track of their risk and compliance status. Vendors are third-party services that your company uses. Add them to
keep track of their risk and compliance status.
</p> </p>
</div> </div>
@@ -233,16 +234,17 @@ function VendorListContent({
if (value.trim() === "") { if (value.trim() === "") {
setFilteredVendors([]); setFilteredVendors([]);
} else { } else {
const results = fuse const results = fuse.search(value).map((result) => result.item);
.search(value)
.map((result) => result.item);
setFilteredVendors(results); setFilteredVendors(results);
} }
}} }}
/> />
{searchTerm.trim() !== "" && filteredVendors.length > 0 && ( {searchTerm.trim() !== "" && filteredVendors.length > 0 && (
<div style={{ borderRadius: "0.3rem" }} className="absolute top-full left-0 mt-1 w-[calc(100%-100px)] max-h-48 overflow-y-auto border bg-popover shadow-md z-10"> <div
style={{ borderRadius: "0.3rem" }}
className="absolute top-full left-0 mt-1 w-[calc(100%-100px)] max-h-48 overflow-y-auto border bg-popover shadow-md z-10"
>
{filteredVendors.map((vendor) => ( {filteredVendors.map((vendor) => (
<button <button
key={vendor.id} key={vendor.id}
@@ -252,7 +254,7 @@ function VendorListContent({
variables: { variables: {
connections: [vendorsConnection.vendors.__id], connections: [vendorsConnection.vendors.__id],
input: { input: {
organizationId: data.currentOrganization.id, organizationId: data.viewer.organization.id,
name: vendor.name, name: vendor.name,
description: "", description: "",
serviceStartAt: new Date().toISOString(), serviceStartAt: new Date().toISOString(),
@@ -316,7 +318,11 @@ function VendorListContent({
className="h-8 w-8 text-muted-foreground hover:bg-transparent [&>svg]:hover:text-destructive" className="h-8 w-8 text-muted-foreground hover:bg-transparent [&>svg]:hover:text-destructive"
onClick={(e) => { onClick={(e) => {
e.preventDefault(); // Prevent navigation e.preventDefault(); // Prevent navigation
if (window.confirm("Are you sure you want to delete this vendor?")) { if (
window.confirm(
"Are you sure you want to delete this vendor?"
)
) {
deleteVendor({ deleteVendor({
variables: { variables: {
connections: [vendorsConnection.vendors.__id], connections: [vendorsConnection.vendors.__id],
@@ -327,7 +333,8 @@ function VendorListContent({
onCompleted() { onCompleted() {
toast({ toast({
title: "Vendor deleted", title: "Vendor deleted",
description: "The vendor has been deleted successfully", description:
"The vendor has been deleted successfully",
}); });
}, },
}); });

View File

@@ -1,5 +1,5 @@
/** /**
* @generated SignedSource<<90c9055cb59db9172002bc02e6e9429d>> * @generated SignedSource<<25866c1f4e6fb640f91b8d05651df9f4>>
* @lightSyntaxTransform * @lightSyntaxTransform
* @nogrep * @nogrep
*/ */
@@ -11,9 +11,12 @@
import { ConcreteRequest } from 'relay-runtime'; import { ConcreteRequest } from 'relay-runtime';
export type CreatePeoplePageQuery$variables = Record<PropertyKey, never>; export type CreatePeoplePageQuery$variables = Record<PropertyKey, never>;
export type CreatePeoplePageQuery$data = { export type CreatePeoplePageQuery$data = {
readonly currentOrganization: { readonly viewer: {
readonly id: string; readonly id: string;
readonly name?: string; readonly organization: {
readonly id: string;
readonly name: string;
};
}; };
}; };
export type CreatePeoplePageQuery = { export type CreatePeoplePageQuery = {
@@ -22,23 +25,32 @@ export type CreatePeoplePageQuery = {
}; };
const node: ConcreteRequest = (function(){ const node: ConcreteRequest = (function(){
var v0 = [ var v0 = {
{
"kind": "Literal",
"name": "id",
"value": "AZSfP_xAcAC5IAAAAAAltA"
}
],
v1 = {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "id", "name": "id",
"storageKey": null "storageKey": null
}, },
v2 = { v1 = [
"kind": "InlineFragment", {
"alias": null,
"args": null,
"concreteType": "Viewer",
"kind": "LinkedField",
"name": "viewer",
"plural": false,
"selections": [ "selections": [
(v0/*: any*/),
{
"alias": null,
"args": null,
"concreteType": "Organization",
"kind": "LinkedField",
"name": "organization",
"plural": false,
"selections": [
(v0/*: any*/),
{ {
"alias": null, "alias": null,
"args": null, "args": null,
@@ -47,30 +59,19 @@ v2 = {
"storageKey": null "storageKey": null
} }
], ],
"type": "Organization", "storageKey": null
"abstractKey": null }
}; ],
"storageKey": null
}
];
return { return {
"fragment": { "fragment": {
"argumentDefinitions": [], "argumentDefinitions": [],
"kind": "Fragment", "kind": "Fragment",
"metadata": null, "metadata": null,
"name": "CreatePeoplePageQuery", "name": "CreatePeoplePageQuery",
"selections": [ "selections": (v1/*: any*/),
{
"alias": "currentOrganization",
"args": (v0/*: any*/),
"concreteType": null,
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
(v1/*: any*/),
(v2/*: any*/)
],
"storageKey": "node(id:\"AZSfP_xAcAC5IAAAAAAltA\")"
}
],
"type": "Query", "type": "Query",
"abstractKey": null "abstractKey": null
}, },
@@ -79,40 +80,19 @@ return {
"argumentDefinitions": [], "argumentDefinitions": [],
"kind": "Operation", "kind": "Operation",
"name": "CreatePeoplePageQuery", "name": "CreatePeoplePageQuery",
"selections": [ "selections": (v1/*: any*/)
{
"alias": "currentOrganization",
"args": (v0/*: any*/),
"concreteType": null,
"kind": "LinkedField",
"name": "node",
"plural": false,
"selections": [
{
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
},
(v1/*: any*/),
(v2/*: any*/)
],
"storageKey": "node(id:\"AZSfP_xAcAC5IAAAAAAltA\")"
}
]
}, },
"params": { "params": {
"cacheID": "816d745d1a69d598b3507fa4df1e878f", "cacheID": "e0b72d4317b700564caa46c609276aed",
"id": null, "id": null,
"metadata": {}, "metadata": {},
"name": "CreatePeoplePageQuery", "name": "CreatePeoplePageQuery",
"operationKind": "query", "operationKind": "query",
"text": "query CreatePeoplePageQuery {\n currentOrganization: node(id: \"AZSfP_xAcAC5IAAAAAAltA\") {\n __typename\n id\n ... on Organization {\n name\n }\n }\n}\n" "text": "query CreatePeoplePageQuery {\n viewer {\n id\n organization {\n id\n name\n }\n }\n}\n"
} }
}; };
})(); })();
(node as any).hash = "54148a2bd398d4fda7c72b60c7210e6d"; (node as any).hash = "89be7e6fd93829bdc8ac374983ca0a9b";
export default node; export default node;

View File

@@ -1,5 +1,5 @@
/** /**
* @generated SignedSource<<87f0a667163355b6f7d273a71aa65a93>> * @generated SignedSource<<b79fe4cf20a9bc930e7bd90ccc2daf03>>
* @lightSyntaxTransform * @lightSyntaxTransform
* @nogrep * @nogrep
*/ */
@@ -12,8 +12,10 @@ import { ConcreteRequest } from 'relay-runtime';
export type ControlState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED"; export type ControlState = "IMPLEMENTED" | "IN_PROGRESS" | "NOT_APPLICABLE" | "NOT_STARTED";
export type FrameworkListPageQuery$variables = Record<PropertyKey, never>; export type FrameworkListPageQuery$variables = Record<PropertyKey, never>;
export type FrameworkListPageQuery$data = { export type FrameworkListPageQuery$data = {
readonly node: { readonly viewer: {
readonly frameworks?: { readonly id: string;
readonly organization: {
readonly frameworks: {
readonly edges: ReadonlyArray<{ readonly edges: ReadonlyArray<{
readonly node: { readonly node: {
readonly controls: { readonly controls: {
@@ -32,7 +34,7 @@ export type FrameworkListPageQuery$data = {
}; };
}>; }>;
}; };
readonly id: string; };
}; };
}; };
export type FrameworkListPageQuery = { export type FrameworkListPageQuery = {
@@ -41,24 +43,14 @@ export type FrameworkListPageQuery = {
}; };
const node: ConcreteRequest = (function(){ const node: ConcreteRequest = (function(){
var v0 = [ var v0 = {
{
"kind": "Literal",
"name": "id",
"value": "AZSfP_xAcAC5IAAAAAAltA"
}
],
v1 = {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "id", "name": "id",
"storageKey": null "storageKey": null
}, },
v2 = { v1 = {
"kind": "InlineFragment",
"selections": [
{
"alias": null, "alias": null,
"args": null, "args": null,
"concreteType": "FrameworkConnection", "concreteType": "FrameworkConnection",
@@ -82,7 +74,7 @@ v2 = {
"name": "node", "name": "node",
"plural": false, "plural": false,
"selections": [ "selections": [
(v1/*: any*/), (v0/*: any*/),
{ {
"alias": null, "alias": null,
"args": null, "args": null,
@@ -121,7 +113,7 @@ v2 = {
"name": "node", "name": "node",
"plural": false, "plural": false,
"selections": [ "selections": [
(v1/*: any*/), (v0/*: any*/),
{ {
"alias": null, "alias": null,
"args": null, "args": null,
@@ -160,10 +152,6 @@ v2 = {
} }
], ],
"storageKey": null "storageKey": null
}
],
"type": "Organization",
"abstractKey": null
}; };
return { return {
"fragment": { "fragment": {
@@ -174,16 +162,27 @@ return {
"selections": [ "selections": [
{ {
"alias": null, "alias": null,
"args": (v0/*: any*/), "args": null,
"concreteType": null, "concreteType": "Viewer",
"kind": "LinkedField", "kind": "LinkedField",
"name": "node", "name": "viewer",
"plural": false, "plural": false,
"selections": [ "selections": [
(v1/*: any*/), (v0/*: any*/),
(v2/*: any*/) {
"alias": null,
"args": null,
"concreteType": "Organization",
"kind": "LinkedField",
"name": "organization",
"plural": false,
"selections": [
(v1/*: any*/)
], ],
"storageKey": "node(id:\"AZSfP_xAcAC5IAAAAAAltA\")" "storageKey": null
}
],
"storageKey": null
} }
], ],
"type": "Query", "type": "Query",
@@ -197,37 +196,42 @@ return {
"selections": [ "selections": [
{ {
"alias": null, "alias": null,
"args": (v0/*: any*/), "args": null,
"concreteType": null, "concreteType": "Viewer",
"kind": "LinkedField", "kind": "LinkedField",
"name": "node", "name": "viewer",
"plural": false, "plural": false,
"selections": [ "selections": [
(v0/*: any*/),
{ {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "concreteType": "Organization",
"name": "__typename", "kind": "LinkedField",
"storageKey": null "name": "organization",
}, "plural": false,
"selections": [
(v1/*: any*/), (v1/*: any*/),
(v2/*: any*/) (v0/*: any*/)
], ],
"storageKey": "node(id:\"AZSfP_xAcAC5IAAAAAAltA\")" "storageKey": null
}
],
"storageKey": null
} }
] ]
}, },
"params": { "params": {
"cacheID": "b9f11bd39a99da4a1693b67c60a85845", "cacheID": "8f573b1a89e302e61a765711c1c6e73a",
"id": null, "id": null,
"metadata": {}, "metadata": {},
"name": "FrameworkListPageQuery", "name": "FrameworkListPageQuery",
"operationKind": "query", "operationKind": "query",
"text": "query FrameworkListPageQuery {\n node(id: \"AZSfP_xAcAC5IAAAAAAltA\") {\n __typename\n id\n ... on Organization {\n frameworks {\n edges {\n node {\n id\n name\n description\n controls {\n edges {\n node {\n id\n state\n }\n }\n }\n createdAt\n updatedAt\n }\n }\n }\n }\n }\n}\n" "text": "query FrameworkListPageQuery {\n viewer {\n id\n organization {\n frameworks {\n edges {\n node {\n id\n name\n description\n controls {\n edges {\n node {\n id\n state\n }\n }\n }\n createdAt\n updatedAt\n }\n }\n }\n id\n }\n }\n}\n"
} }
}; };
})(); })();
(node as any).hash = "cc761cbab629daf0587a9befff255256"; (node as any).hash = "ac0337411177ab9b1c8ef81e6bb47a06";
export default node; export default node;

View File

@@ -1,5 +1,5 @@
/** /**
* @generated SignedSource<<77e7a845bc8d788287f50a2f97600987>> * @generated SignedSource<<d57e3b87db862a1cfa086ea4b410d567>>
* @lightSyntaxTransform * @lightSyntaxTransform
* @nogrep * @nogrep
*/ */
@@ -14,9 +14,11 @@ export type EvidenceState = "EXPIRED" | "INVALID" | "VALID";
export type TaskState = "DONE" | "TODO"; export type TaskState = "DONE" | "TODO";
export type HomePageQuery$variables = Record<PropertyKey, never>; export type HomePageQuery$variables = Record<PropertyKey, never>;
export type HomePageQuery$data = { export type HomePageQuery$data = {
readonly node: { readonly viewer: {
readonly createdAt?: any; readonly id: string;
readonly frameworks?: { readonly organization: {
readonly createdAt: any;
readonly frameworks: {
readonly edges: ReadonlyArray<{ readonly edges: ReadonlyArray<{
readonly cursor: any; readonly cursor: any;
readonly node: { readonly node: {
@@ -98,9 +100,8 @@ export type HomePageQuery$data = {
readonly startCursor: any | null | undefined; readonly startCursor: any | null | undefined;
}; };
}; };
readonly id: string; readonly name: string;
readonly name?: string; readonly peoples: {
readonly peoples?: {
readonly edges: ReadonlyArray<{ readonly edges: ReadonlyArray<{
readonly node: { readonly node: {
readonly additionalEmailAddresses: ReadonlyArray<string>; readonly additionalEmailAddresses: ReadonlyArray<string>;
@@ -112,8 +113,8 @@ export type HomePageQuery$data = {
}; };
}>; }>;
}; };
readonly updatedAt?: any; readonly updatedAt: any;
readonly vendors?: { readonly vendors: {
readonly edges: ReadonlyArray<{ readonly edges: ReadonlyArray<{
readonly node: { readonly node: {
readonly createdAt: any; readonly createdAt: any;
@@ -124,6 +125,7 @@ export type HomePageQuery$data = {
}>; }>;
}; };
}; };
};
}; };
export type HomePageQuery = { export type HomePageQuery = {
response: HomePageQuery$data; response: HomePageQuery$data;
@@ -131,76 +133,35 @@ export type HomePageQuery = {
}; };
const node: ConcreteRequest = (function(){ const node: ConcreteRequest = (function(){
var v0 = [ var v0 = {
{
"kind": "Literal",
"name": "id",
"value": "AZSfP_xAcAC5IAAAAAAltA"
}
],
v1 = {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "id", "name": "id",
"storageKey": null "storageKey": null
}, },
v2 = { v1 = {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "name", "name": "name",
"storageKey": null "storageKey": null
}, },
v3 = { v2 = {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "createdAt", "name": "createdAt",
"storageKey": null "storageKey": null
}, },
v4 = { v3 = {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "updatedAt", "name": "updatedAt",
"storageKey": null "storageKey": null
}, },
v5 = { v4 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "state",
"storageKey": null
},
v6 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "toState",
"storageKey": null
},
v7 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fromState",
"storageKey": null
},
v8 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "reason",
"storageKey": null
},
v9 = {
"kind": "InlineFragment",
"selections": [
(v2/*: any*/),
(v3/*: any*/),
(v4/*: any*/),
{
"alias": null, "alias": null,
"args": null, "args": null,
"concreteType": "VendorConnection", "concreteType": "VendorConnection",
@@ -224,10 +185,10 @@ v9 = {
"name": "node", "name": "node",
"plural": false, "plural": false,
"selections": [ "selections": [
(v0/*: any*/),
(v1/*: any*/), (v1/*: any*/),
(v2/*: any*/), (v2/*: any*/),
(v3/*: any*/), (v3/*: any*/)
(v4/*: any*/)
], ],
"storageKey": null "storageKey": null
} }
@@ -236,8 +197,8 @@ v9 = {
} }
], ],
"storageKey": null "storageKey": null
}, },
{ v5 = {
"alias": null, "alias": null,
"args": null, "args": null,
"concreteType": "PeopleConnection", "concreteType": "PeopleConnection",
@@ -261,7 +222,7 @@ v9 = {
"name": "node", "name": "node",
"plural": false, "plural": false,
"selections": [ "selections": [
(v1/*: any*/), (v0/*: any*/),
{ {
"alias": null, "alias": null,
"args": null, "args": null,
@@ -283,8 +244,8 @@ v9 = {
"name": "additionalEmailAddresses", "name": "additionalEmailAddresses",
"storageKey": null "storageKey": null
}, },
(v3/*: any*/), (v2/*: any*/),
(v4/*: any*/) (v3/*: any*/)
], ],
"storageKey": null "storageKey": null
} }
@@ -293,8 +254,36 @@ v9 = {
} }
], ],
"storageKey": null "storageKey": null
}, },
{ v6 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "state",
"storageKey": null
},
v7 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "toState",
"storageKey": null
},
v8 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "fromState",
"storageKey": null
},
v9 = {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "reason",
"storageKey": null
},
v10 = {
"alias": null, "alias": null,
"args": null, "args": null,
"concreteType": "FrameworkConnection", "concreteType": "FrameworkConnection",
@@ -364,8 +353,8 @@ v9 = {
"name": "node", "name": "node",
"plural": false, "plural": false,
"selections": [ "selections": [
(v0/*: any*/),
(v1/*: any*/), (v1/*: any*/),
(v2/*: any*/),
{ {
"alias": null, "alias": null,
"args": null, "args": null,
@@ -397,9 +386,9 @@ v9 = {
"name": "node", "name": "node",
"plural": false, "plural": false,
"selections": [ "selections": [
(v0/*: any*/),
(v1/*: any*/), (v1/*: any*/),
(v2/*: any*/), (v6/*: any*/),
(v5/*: any*/),
{ {
"alias": null, "alias": null,
"args": null, "args": null,
@@ -424,11 +413,11 @@ v9 = {
"name": "node", "name": "node",
"plural": false, "plural": false,
"selections": [ "selections": [
(v1/*: any*/), (v0/*: any*/),
(v6/*: any*/),
(v7/*: any*/), (v7/*: any*/),
(v3/*: any*/), (v8/*: any*/),
(v4/*: any*/) (v2/*: any*/),
(v3/*: any*/)
], ],
"storageKey": null "storageKey": null
} }
@@ -462,9 +451,9 @@ v9 = {
"name": "node", "name": "node",
"plural": false, "plural": false,
"selections": [ "selections": [
(v0/*: any*/),
(v1/*: any*/), (v1/*: any*/),
(v2/*: any*/), (v6/*: any*/),
(v5/*: any*/),
{ {
"alias": null, "alias": null,
"args": null, "args": null,
@@ -489,8 +478,8 @@ v9 = {
"name": "node", "name": "node",
"plural": false, "plural": false,
"selections": [ "selections": [
(v1/*: any*/), (v0/*: any*/),
(v5/*: any*/), (v6/*: any*/),
{ {
"alias": null, "alias": null,
"args": null, "args": null,
@@ -522,12 +511,12 @@ v9 = {
"name": "node", "name": "node",
"plural": false, "plural": false,
"selections": [ "selections": [
(v1/*: any*/), (v0/*: any*/),
(v7/*: any*/),
(v6/*: any*/),
(v8/*: any*/), (v8/*: any*/),
(v3/*: any*/), (v7/*: any*/),
(v4/*: any*/) (v9/*: any*/),
(v2/*: any*/),
(v3/*: any*/)
], ],
"storageKey": null "storageKey": null
} }
@@ -537,8 +526,8 @@ v9 = {
], ],
"storageKey": null "storageKey": null
}, },
(v3/*: any*/), (v2/*: any*/),
(v4/*: any*/) (v3/*: any*/)
], ],
"storageKey": null "storageKey": null
} }
@@ -572,12 +561,12 @@ v9 = {
"name": "node", "name": "node",
"plural": false, "plural": false,
"selections": [ "selections": [
(v1/*: any*/), (v0/*: any*/),
(v6/*: any*/),
(v7/*: any*/), (v7/*: any*/),
(v8/*: any*/), (v8/*: any*/),
(v3/*: any*/), (v9/*: any*/),
(v4/*: any*/) (v2/*: any*/),
(v3/*: any*/)
], ],
"storageKey": null "storageKey": null
} }
@@ -587,8 +576,8 @@ v9 = {
], ],
"storageKey": null "storageKey": null
}, },
(v3/*: any*/), (v2/*: any*/),
(v4/*: any*/) (v3/*: any*/)
], ],
"storageKey": null "storageKey": null
} }
@@ -615,10 +604,6 @@ v9 = {
} }
], ],
"storageKey": null "storageKey": null
}
],
"type": "Organization",
"abstractKey": null
}; };
return { return {
"fragment": { "fragment": {
@@ -629,16 +614,32 @@ return {
"selections": [ "selections": [
{ {
"alias": null, "alias": null,
"args": (v0/*: any*/), "args": null,
"concreteType": null, "concreteType": "Viewer",
"kind": "LinkedField", "kind": "LinkedField",
"name": "node", "name": "viewer",
"plural": false,
"selections": [
(v0/*: any*/),
{
"alias": null,
"args": null,
"concreteType": "Organization",
"kind": "LinkedField",
"name": "organization",
"plural": false, "plural": false,
"selections": [ "selections": [
(v1/*: any*/), (v1/*: any*/),
(v9/*: any*/) (v2/*: any*/),
(v3/*: any*/),
(v4/*: any*/),
(v5/*: any*/),
(v10/*: any*/)
], ],
"storageKey": "node(id:\"AZSfP_xAcAC5IAAAAAAltA\")" "storageKey": null
}
],
"storageKey": null
} }
], ],
"type": "Query", "type": "Query",
@@ -652,37 +653,47 @@ return {
"selections": [ "selections": [
{ {
"alias": null, "alias": null,
"args": (v0/*: any*/), "args": null,
"concreteType": null, "concreteType": "Viewer",
"kind": "LinkedField", "kind": "LinkedField",
"name": "node", "name": "viewer",
"plural": false, "plural": false,
"selections": [ "selections": [
(v0/*: any*/),
{ {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "concreteType": "Organization",
"name": "__typename", "kind": "LinkedField",
"storageKey": null "name": "organization",
}, "plural": false,
"selections": [
(v1/*: any*/), (v1/*: any*/),
(v9/*: any*/) (v2/*: any*/),
(v3/*: any*/),
(v4/*: any*/),
(v5/*: any*/),
(v10/*: any*/),
(v0/*: any*/)
], ],
"storageKey": "node(id:\"AZSfP_xAcAC5IAAAAAAltA\")" "storageKey": null
}
],
"storageKey": null
} }
] ]
}, },
"params": { "params": {
"cacheID": "c73dd7150596d3c0f5a6182fa68bbdc7", "cacheID": "9f8dd0b1a2698dd2d944e75de5d32087",
"id": null, "id": null,
"metadata": {}, "metadata": {},
"name": "HomePageQuery", "name": "HomePageQuery",
"operationKind": "query", "operationKind": "query",
"text": "query HomePageQuery {\n node(id: \"AZSfP_xAcAC5IAAAAAAltA\") {\n __typename\n id\n ... on Organization {\n name\n createdAt\n updatedAt\n vendors {\n edges {\n node {\n id\n name\n createdAt\n updatedAt\n }\n }\n }\n peoples {\n edges {\n node {\n id\n fullName\n primaryEmailAddress\n additionalEmailAddresses\n createdAt\n updatedAt\n }\n }\n }\n frameworks {\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n edges {\n cursor\n node {\n id\n name\n description\n controls {\n edges {\n node {\n id\n name\n state\n stateTransisions {\n edges {\n node {\n id\n toState\n fromState\n createdAt\n updatedAt\n }\n }\n }\n tasks {\n edges {\n node {\n id\n name\n state\n evidences {\n edges {\n node {\n id\n state\n fileUrl\n stateTransisions {\n edges {\n node {\n id\n fromState\n toState\n reason\n createdAt\n updatedAt\n }\n }\n }\n createdAt\n updatedAt\n }\n }\n }\n stateTransisions {\n edges {\n node {\n id\n toState\n fromState\n reason\n createdAt\n updatedAt\n }\n }\n }\n createdAt\n updatedAt\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}\n" "text": "query HomePageQuery {\n viewer {\n id\n organization {\n name\n createdAt\n updatedAt\n vendors {\n edges {\n node {\n id\n name\n createdAt\n updatedAt\n }\n }\n }\n peoples {\n edges {\n node {\n id\n fullName\n primaryEmailAddress\n additionalEmailAddresses\n createdAt\n updatedAt\n }\n }\n }\n frameworks {\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n edges {\n cursor\n node {\n id\n name\n description\n controls {\n edges {\n node {\n id\n name\n state\n stateTransisions {\n edges {\n node {\n id\n toState\n fromState\n createdAt\n updatedAt\n }\n }\n }\n tasks {\n edges {\n node {\n id\n name\n state\n evidences {\n edges {\n node {\n id\n state\n fileUrl\n stateTransisions {\n edges {\n node {\n id\n fromState\n toState\n reason\n createdAt\n updatedAt\n }\n }\n }\n createdAt\n updatedAt\n }\n }\n }\n stateTransisions {\n edges {\n node {\n id\n toState\n fromState\n reason\n createdAt\n updatedAt\n }\n }\n }\n createdAt\n updatedAt\n }\n }\n }\n }\n }\n }\n }\n }\n }\n id\n }\n }\n}\n"
} }
}; };
})(); })();
(node as any).hash = "8ecbd457d85e0552b610b3942cc0c228"; (node as any).hash = "875e681cb7e936d3f1a543e88c4cb2d0";
export default node; export default node;

View File

@@ -1,5 +1,5 @@
/** /**
* @generated SignedSource<<7a16966c3cf3d76ae51330e5536df480>> * @generated SignedSource<<dde370798e95a61988dd69cdde3acaad>>
* @lightSyntaxTransform * @lightSyntaxTransform
* @nogrep * @nogrep
*/ */
@@ -17,10 +17,12 @@ export type PeopleListPageQuery$variables = {
last?: number | null | undefined; last?: number | null | undefined;
}; };
export type PeopleListPageQuery$data = { export type PeopleListPageQuery$data = {
readonly currentOrganization: { readonly viewer: {
readonly id: string; readonly id: string;
readonly organization: {
readonly " $fragmentSpreads": FragmentRefs<"PeopleListPage_peoples">; readonly " $fragmentSpreads": FragmentRefs<"PeopleListPage_peoples">;
}; };
};
}; };
export type PeopleListPageQuery = { export type PeopleListPageQuery = {
response: PeopleListPageQuery$data; response: PeopleListPageQuery$data;
@@ -48,28 +50,14 @@ v3 = {
"kind": "LocalArgument", "kind": "LocalArgument",
"name": "last" "name": "last"
}, },
v4 = [ v4 = {
{
"kind": "Literal",
"name": "id",
"value": "AZSfP_xAcAC5IAAAAAAltA"
}
],
v5 = {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "id", "name": "id",
"storageKey": null "storageKey": null
}, },
v6 = { v5 = [
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
},
v7 = [
{ {
"kind": "Variable", "kind": "Variable",
"name": "after", "name": "after",
@@ -104,16 +92,21 @@ return {
"name": "PeopleListPageQuery", "name": "PeopleListPageQuery",
"selections": [ "selections": [
{ {
"alias": "currentOrganization", "alias": null,
"args": (v4/*: any*/), "args": null,
"concreteType": null, "concreteType": "Viewer",
"kind": "LinkedField", "kind": "LinkedField",
"name": "node", "name": "viewer",
"plural": false, "plural": false,
"selections": [ "selections": [
(v5/*: any*/), (v4/*: any*/),
{ {
"kind": "InlineFragment", "alias": null,
"args": null,
"concreteType": "Organization",
"kind": "LinkedField",
"name": "organization",
"plural": false,
"selections": [ "selections": [
{ {
"args": null, "args": null,
@@ -121,11 +114,10 @@ return {
"name": "PeopleListPage_peoples" "name": "PeopleListPage_peoples"
} }
], ],
"type": "Organization", "storageKey": null
"abstractKey": null
} }
], ],
"storageKey": "node(id:\"AZSfP_xAcAC5IAAAAAAltA\")" "storageKey": null
} }
], ],
"type": "Query", "type": "Query",
@@ -143,21 +135,26 @@ return {
"name": "PeopleListPageQuery", "name": "PeopleListPageQuery",
"selections": [ "selections": [
{ {
"alias": "currentOrganization", "alias": null,
"args": (v4/*: any*/), "args": null,
"concreteType": null, "concreteType": "Viewer",
"kind": "LinkedField", "kind": "LinkedField",
"name": "node", "name": "viewer",
"plural": false, "plural": false,
"selections": [ "selections": [
(v6/*: any*/), (v4/*: any*/),
(v5/*: any*/),
{
"kind": "InlineFragment",
"selections": [
{ {
"alias": null, "alias": null,
"args": (v7/*: any*/), "args": null,
"concreteType": "Organization",
"kind": "LinkedField",
"name": "organization",
"plural": false,
"selections": [
(v4/*: any*/),
{
"alias": null,
"args": (v5/*: any*/),
"concreteType": "PeopleConnection", "concreteType": "PeopleConnection",
"kind": "LinkedField", "kind": "LinkedField",
"name": "peoples", "name": "peoples",
@@ -179,7 +176,7 @@ return {
"name": "node", "name": "node",
"plural": false, "plural": false,
"selections": [ "selections": [
(v5/*: any*/), (v4/*: any*/),
{ {
"alias": null, "alias": null,
"args": null, "args": null,
@@ -222,7 +219,13 @@ return {
"name": "updatedAt", "name": "updatedAt",
"storageKey": null "storageKey": null
}, },
(v6/*: any*/) {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
}
], ],
"storageKey": null "storageKey": null
}, },
@@ -292,7 +295,7 @@ return {
}, },
{ {
"alias": null, "alias": null,
"args": (v7/*: any*/), "args": (v5/*: any*/),
"filters": null, "filters": null,
"handle": "connection", "handle": "connection",
"key": "PeopleListPage_peoples", "key": "PeopleListPage_peoples",
@@ -300,25 +303,24 @@ return {
"name": "peoples" "name": "peoples"
} }
], ],
"type": "Organization", "storageKey": null
"abstractKey": null
} }
], ],
"storageKey": "node(id:\"AZSfP_xAcAC5IAAAAAAltA\")" "storageKey": null
} }
] ]
}, },
"params": { "params": {
"cacheID": "99597791fe9f240b902affc3d5e63af6", "cacheID": "d9b0af5656fcb50e2cedf0f831c0394d",
"id": null, "id": null,
"metadata": {}, "metadata": {},
"name": "PeopleListPageQuery", "name": "PeopleListPageQuery",
"operationKind": "query", "operationKind": "query",
"text": "query PeopleListPageQuery(\n $first: Int\n $after: CursorKey\n $last: Int\n $before: CursorKey\n) {\n currentOrganization: node(id: \"AZSfP_xAcAC5IAAAAAAltA\") {\n __typename\n id\n ... on Organization {\n ...PeopleListPage_peoples\n }\n }\n}\n\nfragment PeopleListPage_peoples on Organization {\n id\n peoples(first: $first, after: $after, last: $last, before: $before) {\n edges {\n node {\n id\n fullName\n primaryEmailAddress\n additionalEmailAddresses\n kind\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n}\n" "text": "query PeopleListPageQuery(\n $first: Int\n $after: CursorKey\n $last: Int\n $before: CursorKey\n) {\n viewer {\n id\n organization {\n ...PeopleListPage_peoples\n id\n }\n }\n}\n\nfragment PeopleListPage_peoples on Organization {\n id\n peoples(first: $first, after: $after, last: $last, before: $before) {\n edges {\n node {\n id\n fullName\n primaryEmailAddress\n additionalEmailAddresses\n kind\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n}\n"
} }
}; };
})(); })();
(node as any).hash = "f9f133aa09d9d051cef5697aba2398c5"; (node as any).hash = "9646de6e2d6b844cb87945b8a26c0999";
export default node; export default node;

View File

@@ -1,5 +1,5 @@
/** /**
* @generated SignedSource<<1daa3e6f3ef43392ed73ce9ddb46aa47>> * @generated SignedSource<<fab1b817b8d6876b5bf4dc9320c4deef>>
* @lightSyntaxTransform * @lightSyntaxTransform
* @nogrep * @nogrep
*/ */
@@ -11,10 +11,12 @@
import { ConcreteRequest } from 'relay-runtime'; import { ConcreteRequest } from 'relay-runtime';
export type SettingsPageQuery$variables = Record<PropertyKey, never>; export type SettingsPageQuery$variables = Record<PropertyKey, never>;
export type SettingsPageQuery$data = { export type SettingsPageQuery$data = {
readonly node: { readonly viewer: {
readonly id: string; readonly id: string;
readonly logoUrl?: string; readonly organization: {
readonly name?: string; readonly logoUrl: string;
readonly name: string;
};
}; };
}; };
export type SettingsPageQuery = { export type SettingsPageQuery = {
@@ -23,40 +25,26 @@ export type SettingsPageQuery = {
}; };
const node: ConcreteRequest = (function(){ const node: ConcreteRequest = (function(){
var v0 = [ var v0 = {
{
"kind": "Literal",
"name": "id",
"value": "AZSfP_xAcAC5IAAAAAAltA"
}
],
v1 = {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "id", "name": "id",
"storageKey": null "storageKey": null
}, },
v2 = { v1 = {
"kind": "InlineFragment",
"selections": [
{
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "name", "name": "name",
"storageKey": null "storageKey": null
}, },
{ v2 = {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "logoUrl", "name": "logoUrl",
"storageKey": null "storageKey": null
}
],
"type": "Organization",
"abstractKey": null
}; };
return { return {
"fragment": { "fragment": {
@@ -67,16 +55,28 @@ return {
"selections": [ "selections": [
{ {
"alias": null, "alias": null,
"args": (v0/*: any*/), "args": null,
"concreteType": null, "concreteType": "Viewer",
"kind": "LinkedField", "kind": "LinkedField",
"name": "node", "name": "viewer",
"plural": false,
"selections": [
(v0/*: any*/),
{
"alias": null,
"args": null,
"concreteType": "Organization",
"kind": "LinkedField",
"name": "organization",
"plural": false, "plural": false,
"selections": [ "selections": [
(v1/*: any*/), (v1/*: any*/),
(v2/*: any*/) (v2/*: any*/)
], ],
"storageKey": "node(id:\"AZSfP_xAcAC5IAAAAAAltA\")" "storageKey": null
}
],
"storageKey": null
} }
], ],
"type": "Query", "type": "Query",
@@ -90,37 +90,43 @@ return {
"selections": [ "selections": [
{ {
"alias": null, "alias": null,
"args": (v0/*: any*/), "args": null,
"concreteType": null, "concreteType": "Viewer",
"kind": "LinkedField", "kind": "LinkedField",
"name": "node", "name": "viewer",
"plural": false, "plural": false,
"selections": [ "selections": [
(v0/*: any*/),
{ {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "concreteType": "Organization",
"name": "__typename", "kind": "LinkedField",
"storageKey": null "name": "organization",
}, "plural": false,
"selections": [
(v1/*: any*/), (v1/*: any*/),
(v2/*: any*/) (v2/*: any*/),
(v0/*: any*/)
], ],
"storageKey": "node(id:\"AZSfP_xAcAC5IAAAAAAltA\")" "storageKey": null
}
],
"storageKey": null
} }
] ]
}, },
"params": { "params": {
"cacheID": "911c50f40d00159bd8201b7193fe6686", "cacheID": "77d3f8660df07b02aa515461c9ec1449",
"id": null, "id": null,
"metadata": {}, "metadata": {},
"name": "SettingsPageQuery", "name": "SettingsPageQuery",
"operationKind": "query", "operationKind": "query",
"text": "query SettingsPageQuery {\n node(id: \"AZSfP_xAcAC5IAAAAAAltA\") {\n __typename\n id\n ... on Organization {\n name\n logoUrl\n }\n }\n}\n" "text": "query SettingsPageQuery {\n viewer {\n id\n organization {\n name\n logoUrl\n id\n }\n }\n}\n"
} }
}; };
})(); })();
(node as any).hash = "fc0474b3b161e0a1e6c41f9898afa5b0"; (node as any).hash = "c639e9c45b175beec64550bb72fe5111";
export default node; export default node;

View File

@@ -1,5 +1,5 @@
/** /**
* @generated SignedSource<<65ad922b0229a2d1840687c46d5cea29>> * @generated SignedSource<<4b2d9a3c1a701053fe929da59580308b>>
* @lightSyntaxTransform * @lightSyntaxTransform
* @nogrep * @nogrep
*/ */
@@ -17,10 +17,12 @@ export type VendorListPageQuery$variables = {
last?: number | null | undefined; last?: number | null | undefined;
}; };
export type VendorListPageQuery$data = { export type VendorListPageQuery$data = {
readonly currentOrganization: { readonly viewer: {
readonly id: string; readonly id: string;
readonly organization: {
readonly " $fragmentSpreads": FragmentRefs<"VendorListPage_vendors">; readonly " $fragmentSpreads": FragmentRefs<"VendorListPage_vendors">;
}; };
};
}; };
export type VendorListPageQuery = { export type VendorListPageQuery = {
response: VendorListPageQuery$data; response: VendorListPageQuery$data;
@@ -48,28 +50,14 @@ v3 = {
"kind": "LocalArgument", "kind": "LocalArgument",
"name": "last" "name": "last"
}, },
v4 = [ v4 = {
{
"kind": "Literal",
"name": "id",
"value": "AZSfP_xAcAC5IAAAAAAltA"
}
],
v5 = {
"alias": null, "alias": null,
"args": null, "args": null,
"kind": "ScalarField", "kind": "ScalarField",
"name": "id", "name": "id",
"storageKey": null "storageKey": null
}, },
v6 = { v5 = [
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
},
v7 = [
{ {
"kind": "Variable", "kind": "Variable",
"name": "after", "name": "after",
@@ -104,16 +92,21 @@ return {
"name": "VendorListPageQuery", "name": "VendorListPageQuery",
"selections": [ "selections": [
{ {
"alias": "currentOrganization", "alias": null,
"args": (v4/*: any*/), "args": null,
"concreteType": null, "concreteType": "Viewer",
"kind": "LinkedField", "kind": "LinkedField",
"name": "node", "name": "viewer",
"plural": false, "plural": false,
"selections": [ "selections": [
(v5/*: any*/), (v4/*: any*/),
{ {
"kind": "InlineFragment", "alias": null,
"args": null,
"concreteType": "Organization",
"kind": "LinkedField",
"name": "organization",
"plural": false,
"selections": [ "selections": [
{ {
"args": null, "args": null,
@@ -121,11 +114,10 @@ return {
"name": "VendorListPage_vendors" "name": "VendorListPage_vendors"
} }
], ],
"type": "Organization", "storageKey": null
"abstractKey": null
} }
], ],
"storageKey": "node(id:\"AZSfP_xAcAC5IAAAAAAltA\")" "storageKey": null
} }
], ],
"type": "Query", "type": "Query",
@@ -143,21 +135,26 @@ return {
"name": "VendorListPageQuery", "name": "VendorListPageQuery",
"selections": [ "selections": [
{ {
"alias": "currentOrganization", "alias": null,
"args": (v4/*: any*/), "args": null,
"concreteType": null, "concreteType": "Viewer",
"kind": "LinkedField", "kind": "LinkedField",
"name": "node", "name": "viewer",
"plural": false, "plural": false,
"selections": [ "selections": [
(v6/*: any*/), (v4/*: any*/),
(v5/*: any*/),
{
"kind": "InlineFragment",
"selections": [
{ {
"alias": null, "alias": null,
"args": (v7/*: any*/), "args": null,
"concreteType": "Organization",
"kind": "LinkedField",
"name": "organization",
"plural": false,
"selections": [
(v4/*: any*/),
{
"alias": null,
"args": (v5/*: any*/),
"concreteType": "VendorConnection", "concreteType": "VendorConnection",
"kind": "LinkedField", "kind": "LinkedField",
"name": "vendors", "name": "vendors",
@@ -179,7 +176,7 @@ return {
"name": "node", "name": "node",
"plural": false, "plural": false,
"selections": [ "selections": [
(v5/*: any*/), (v4/*: any*/),
{ {
"alias": null, "alias": null,
"args": null, "args": null,
@@ -208,7 +205,13 @@ return {
"name": "updatedAt", "name": "updatedAt",
"storageKey": null "storageKey": null
}, },
(v6/*: any*/) {
"alias": null,
"args": null,
"kind": "ScalarField",
"name": "__typename",
"storageKey": null
}
], ],
"storageKey": null "storageKey": null
}, },
@@ -278,7 +281,7 @@ return {
}, },
{ {
"alias": null, "alias": null,
"args": (v7/*: any*/), "args": (v5/*: any*/),
"filters": null, "filters": null,
"handle": "connection", "handle": "connection",
"key": "VendorListPage_vendors", "key": "VendorListPage_vendors",
@@ -286,25 +289,24 @@ return {
"name": "vendors" "name": "vendors"
} }
], ],
"type": "Organization", "storageKey": null
"abstractKey": null
} }
], ],
"storageKey": "node(id:\"AZSfP_xAcAC5IAAAAAAltA\")" "storageKey": null
} }
] ]
}, },
"params": { "params": {
"cacheID": "8150b3303765174bbf41ebf4cd12534c", "cacheID": "0c3f0f24d810d8a510fa30ca3f3f5890",
"id": null, "id": null,
"metadata": {}, "metadata": {},
"name": "VendorListPageQuery", "name": "VendorListPageQuery",
"operationKind": "query", "operationKind": "query",
"text": "query VendorListPageQuery(\n $first: Int\n $after: CursorKey\n $last: Int\n $before: CursorKey\n) {\n currentOrganization: node(id: \"AZSfP_xAcAC5IAAAAAAltA\") {\n __typename\n id\n ... on Organization {\n ...VendorListPage_vendors\n }\n }\n}\n\nfragment VendorListPage_vendors on Organization {\n id\n vendors(first: $first, after: $after, last: $last, before: $before) {\n edges {\n node {\n id\n name\n description\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n}\n" "text": "query VendorListPageQuery(\n $first: Int\n $after: CursorKey\n $last: Int\n $before: CursorKey\n) {\n viewer {\n id\n organization {\n ...VendorListPage_vendors\n id\n }\n }\n}\n\nfragment VendorListPage_vendors on Organization {\n id\n vendors(first: $first, after: $after, last: $last, before: $before) {\n edges {\n node {\n id\n name\n description\n createdAt\n updatedAt\n __typename\n }\n cursor\n }\n pageInfo {\n hasNextPage\n hasPreviousPage\n startCursor\n endCursor\n }\n }\n}\n"
} }
}; };
})(); })();
(node as any).hash = "a1f88bf5287abaffb051993051d0e2a7"; (node as any).hash = "ffd0aaecc51a29f19ff874adbb38dab4";
export default node; export default node;

View File

@@ -9,9 +9,7 @@ directive @goModel(
models: [String!] models: [String!]
) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION ) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION
directive @goEnum( directive @goEnum(value: String) on ENUM_VALUE
value: String
) on ENUM_VALUE
scalar CursorKey scalar CursorKey
scalar Void scalar Void
@@ -22,27 +20,62 @@ interface Node {
id: ID! id: ID!
} }
enum ControlState @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.ControlState") { enum ControlState
NOT_STARTED @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.ControlStateNotStarted") @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.ControlState") {
IN_PROGRESS @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.ControlStateInProgress") NOT_STARTED
NOT_APPLICABLE @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.ControlStateNotApplicable") @goEnum(
IMPLEMENTED @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.ControlStateImplemented") value: "github.com/getprobo/probo/pkg/probo/coredata.ControlStateNotStarted"
)
IN_PROGRESS
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.ControlStateInProgress"
)
NOT_APPLICABLE
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.ControlStateNotApplicable"
)
IMPLEMENTED
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.ControlStateImplemented"
)
} }
enum TaskState @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.TaskState") { enum TaskState
TODO @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.TaskStateTodo") @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.TaskState") {
DONE @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.TaskStateDone") TODO
@goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.TaskStateTodo")
DONE
@goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.TaskStateDone")
} }
enum EvidenceState @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.EvidenceState") { enum EvidenceState
VALID @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.EvidenceStateValid") @goModel(
INVALID @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.EvidenceStateInvalid") model: "github.com/getprobo/probo/pkg/probo/coredata.EvidenceState"
EXPIRED @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.EvidenceStateExpired") ) {
VALID
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.EvidenceStateValid"
)
INVALID
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.EvidenceStateInvalid"
)
EXPIRED
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.EvidenceStateExpired"
)
} }
enum PeopleKind @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.PeopleKind") { enum PeopleKind
EMPLOYEE @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.PeopleKindEmployee") @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.PeopleKind") {
CONTRACTOR @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.PeopleKindContractor") EMPLOYEE
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.PeopleKindEmployee"
)
CONTRACTOR
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.PeopleKindContractor"
)
} }
type PageInfo { type PageInfo {
@@ -311,6 +344,12 @@ type EvidenceStateTransition {
type Query { type Query {
node(id: ID!): Node! node(id: ID!): Node!
viewer: Viewer!
}
type Viewer {
id: ID!
organization: Organization! @goField(forceResolver: true)
} }
type Mutation { type Mutation {
@@ -360,16 +399,38 @@ input UpdatePeopleInput {
kind: PeopleKind kind: PeopleKind
} }
enum ServiceCriticality @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.ServiceCriticality") { enum ServiceCriticality
LOW @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.ServiceCriticalityLow") @goModel(
MEDIUM @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.ServiceCriticalityMedium") model: "github.com/getprobo/probo/pkg/probo/coredata.ServiceCriticality"
HIGH @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.ServiceCriticalityHigh") ) {
LOW
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.ServiceCriticalityLow"
)
MEDIUM
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.ServiceCriticalityMedium"
)
HIGH
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.ServiceCriticalityHigh"
)
} }
enum RiskTier @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.RiskTier") { enum RiskTier
CRITICAL @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.RiskTierCritical") @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.RiskTier") {
SIGNIFICANT @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.RiskTierSignificant") CRITICAL
GENERAL @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.RiskTierGeneral") @goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.RiskTierCritical"
)
SIGNIFICANT
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.RiskTierSignificant"
)
GENERAL
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.RiskTierGeneral"
)
} }
input UpdateVendorInput { input UpdateVendorInput {

View File

@@ -49,6 +49,7 @@ type ResolverRoot interface {
Organization() OrganizationResolver Organization() OrganizationResolver
Query() QueryResolver Query() QueryResolver
Task() TaskResolver Task() TaskResolver
Viewer() ViewerResolver
} }
type DirectiveRoot struct { type DirectiveRoot struct {
@@ -221,6 +222,7 @@ type ComplexityRoot struct {
Query struct { Query struct {
Node func(childComplexity int, id gid.GID) int Node func(childComplexity int, id gid.GID) int
Viewer func(childComplexity int) int
} }
Task struct { Task struct {
@@ -288,6 +290,11 @@ type ComplexityRoot struct {
Cursor func(childComplexity int) int Cursor func(childComplexity int) int
Node func(childComplexity int) int Node func(childComplexity int) int
} }
Viewer struct {
ID func(childComplexity int) int
Organization func(childComplexity int) int
}
} }
type ControlResolver interface { type ControlResolver interface {
@@ -315,11 +322,15 @@ type OrganizationResolver interface {
} }
type QueryResolver interface { type QueryResolver interface {
Node(ctx context.Context, id gid.GID) (types.Node, error) Node(ctx context.Context, id gid.GID) (types.Node, error)
Viewer(ctx context.Context) (*types.Viewer, error)
} }
type TaskResolver interface { type TaskResolver interface {
StateTransisions(ctx context.Context, obj *types.Task, first *int, after *page.CursorKey, last *int, before *page.CursorKey) (*types.TaskStateTransitionConnection, error) StateTransisions(ctx context.Context, obj *types.Task, first *int, after *page.CursorKey, last *int, before *page.CursorKey) (*types.TaskStateTransitionConnection, error)
Evidences(ctx context.Context, obj *types.Task, first *int, after *page.CursorKey, last *int, before *page.CursorKey) (*types.EvidenceConnection, error) Evidences(ctx context.Context, obj *types.Task, first *int, after *page.CursorKey, last *int, before *page.CursorKey) (*types.EvidenceConnection, error)
} }
type ViewerResolver interface {
Organization(ctx context.Context, obj *types.Viewer) (*types.Organization, error)
}
type executableSchema struct { type executableSchema struct {
schema *ast.Schema schema *ast.Schema
@@ -1040,6 +1051,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
return e.complexity.Query.Node(childComplexity, args["id"].(gid.GID)), true return e.complexity.Query.Node(childComplexity, args["id"].(gid.GID)), true
case "Query.viewer":
if e.complexity.Query.Viewer == nil {
break
}
return e.complexity.Query.Viewer(childComplexity), true
case "Task.createdAt": case "Task.createdAt":
if e.complexity.Task.CreatedAt == nil { if e.complexity.Task.CreatedAt == nil {
break break
@@ -1323,6 +1341,20 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in
return e.complexity.VendorEdge.Node(childComplexity), true return e.complexity.VendorEdge.Node(childComplexity), true
case "Viewer.id":
if e.complexity.Viewer.ID == nil {
break
}
return e.complexity.Viewer.ID(childComplexity), true
case "Viewer.organization":
if e.complexity.Viewer.Organization == nil {
break
}
return e.complexity.Viewer.Organization(childComplexity), true
} }
return 0, false return 0, false
} }
@@ -1445,9 +1477,7 @@ directive @goModel(
models: [String!] models: [String!]
) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION ) on OBJECT | INPUT_OBJECT | SCALAR | ENUM | INTERFACE | UNION
directive @goEnum( directive @goEnum(value: String) on ENUM_VALUE
value: String
) on ENUM_VALUE
scalar CursorKey scalar CursorKey
scalar Void scalar Void
@@ -1458,27 +1488,62 @@ interface Node {
id: ID! id: ID!
} }
enum ControlState @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.ControlState") { enum ControlState
NOT_STARTED @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.ControlStateNotStarted") @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.ControlState") {
IN_PROGRESS @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.ControlStateInProgress") NOT_STARTED
NOT_APPLICABLE @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.ControlStateNotApplicable") @goEnum(
IMPLEMENTED @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.ControlStateImplemented") value: "github.com/getprobo/probo/pkg/probo/coredata.ControlStateNotStarted"
)
IN_PROGRESS
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.ControlStateInProgress"
)
NOT_APPLICABLE
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.ControlStateNotApplicable"
)
IMPLEMENTED
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.ControlStateImplemented"
)
} }
enum TaskState @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.TaskState") { enum TaskState
TODO @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.TaskStateTodo") @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.TaskState") {
DONE @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.TaskStateDone") TODO
@goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.TaskStateTodo")
DONE
@goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.TaskStateDone")
} }
enum EvidenceState @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.EvidenceState") { enum EvidenceState
VALID @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.EvidenceStateValid") @goModel(
INVALID @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.EvidenceStateInvalid") model: "github.com/getprobo/probo/pkg/probo/coredata.EvidenceState"
EXPIRED @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.EvidenceStateExpired") ) {
VALID
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.EvidenceStateValid"
)
INVALID
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.EvidenceStateInvalid"
)
EXPIRED
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.EvidenceStateExpired"
)
} }
enum PeopleKind @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.PeopleKind") { enum PeopleKind
EMPLOYEE @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.PeopleKindEmployee") @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.PeopleKind") {
CONTRACTOR @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.PeopleKindContractor") EMPLOYEE
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.PeopleKindEmployee"
)
CONTRACTOR
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.PeopleKindContractor"
)
} }
type PageInfo { type PageInfo {
@@ -1747,6 +1812,12 @@ type EvidenceStateTransition {
type Query { type Query {
node(id: ID!): Node! node(id: ID!): Node!
viewer: Viewer!
}
type Viewer {
id: ID!
organization: Organization! @goField(forceResolver: true)
} }
type Mutation { type Mutation {
@@ -1796,16 +1867,38 @@ input UpdatePeopleInput {
kind: PeopleKind kind: PeopleKind
} }
enum ServiceCriticality @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.ServiceCriticality") { enum ServiceCriticality
LOW @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.ServiceCriticalityLow") @goModel(
MEDIUM @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.ServiceCriticalityMedium") model: "github.com/getprobo/probo/pkg/probo/coredata.ServiceCriticality"
HIGH @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.ServiceCriticalityHigh") ) {
LOW
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.ServiceCriticalityLow"
)
MEDIUM
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.ServiceCriticalityMedium"
)
HIGH
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.ServiceCriticalityHigh"
)
} }
enum RiskTier @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.RiskTier") { enum RiskTier
CRITICAL @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.RiskTierCritical") @goModel(model: "github.com/getprobo/probo/pkg/probo/coredata.RiskTier") {
SIGNIFICANT @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.RiskTierSignificant") CRITICAL
GENERAL @goEnum(value: "github.com/getprobo/probo/pkg/probo/coredata.RiskTierGeneral") @goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.RiskTierCritical"
)
SIGNIFICANT
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.RiskTierSignificant"
)
GENERAL
@goEnum(
value: "github.com/getprobo/probo/pkg/probo/coredata.RiskTierGeneral"
)
} }
input UpdateVendorInput { input UpdateVendorInput {
@@ -6558,6 +6651,50 @@ func (ec *executionContext) fieldContext_Query_node(ctx context.Context, field g
return fc, nil return fc, nil
} }
func (ec *executionContext) _Query_viewer(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_Query_viewer(ctx, field)
if err != nil {
return graphql.Null
}
ctx = graphql.WithFieldContext(ctx, fc)
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
ctx = rctx // use context from middleware stack in children
return ec.resolvers.Query().Viewer(rctx)
})
if err != nil {
ec.Error(ctx, err)
return graphql.Null
}
if resTmp == nil {
if !graphql.HasFieldError(ctx, fc) {
ec.Errorf(ctx, "must not be null")
}
return graphql.Null
}
res := resTmp.(*types.Viewer)
fc.Result = res
return ec.marshalNViewer2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋapiᚋconsoleᚋv1ᚋtypesᚐViewer(ctx, field.Selections, res)
}
func (ec *executionContext) fieldContext_Query_viewer(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Query",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_Viewer_id(ctx, field)
case "organization":
return ec.fieldContext_Viewer_organization(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type Viewer", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { func (ec *executionContext) _Query___type(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_Query___type(ctx, field) fc, err := ec.fieldContext_Query___type(ctx, field)
if err != nil { if err != nil {
@@ -8263,6 +8400,100 @@ func (ec *executionContext) fieldContext_VendorEdge_node(_ context.Context, fiel
return fc, nil return fc, nil
} }
func (ec *executionContext) _Viewer_id(ctx context.Context, field graphql.CollectedField, obj *types.Viewer) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_Viewer_id(ctx, field)
if err != nil {
return graphql.Null
}
ctx = graphql.WithFieldContext(ctx, fc)
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
ctx = rctx // use context from middleware stack in children
return obj.ID, nil
})
if err != nil {
ec.Error(ctx, err)
return graphql.Null
}
if resTmp == nil {
if !graphql.HasFieldError(ctx, fc) {
ec.Errorf(ctx, "must not be null")
}
return graphql.Null
}
res := resTmp.(gid.GID)
fc.Result = res
return ec.marshalNID2githubᚗcomᚋgetproboᚋproboᚋpkgᚋgidᚐGID(ctx, field.Selections, res)
}
func (ec *executionContext) fieldContext_Viewer_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Viewer",
Field: field,
IsMethod: false,
IsResolver: false,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
return nil, errors.New("field of type ID does not have child fields")
},
}
return fc, nil
}
func (ec *executionContext) _Viewer_organization(ctx context.Context, field graphql.CollectedField, obj *types.Viewer) (ret graphql.Marshaler) {
fc, err := ec.fieldContext_Viewer_organization(ctx, field)
if err != nil {
return graphql.Null
}
ctx = graphql.WithFieldContext(ctx, fc)
resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (any, error) {
ctx = rctx // use context from middleware stack in children
return ec.resolvers.Viewer().Organization(rctx, obj)
})
if err != nil {
ec.Error(ctx, err)
return graphql.Null
}
if resTmp == nil {
if !graphql.HasFieldError(ctx, fc) {
ec.Errorf(ctx, "must not be null")
}
return graphql.Null
}
res := resTmp.(*types.Organization)
fc.Result = res
return ec.marshalNOrganization2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋapiᚋconsoleᚋv1ᚋtypesᚐOrganization(ctx, field.Selections, res)
}
func (ec *executionContext) fieldContext_Viewer_organization(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
fc = &graphql.FieldContext{
Object: "Viewer",
Field: field,
IsMethod: true,
IsResolver: true,
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
switch field.Name {
case "id":
return ec.fieldContext_Organization_id(ctx, field)
case "name":
return ec.fieldContext_Organization_name(ctx, field)
case "logoUrl":
return ec.fieldContext_Organization_logoUrl(ctx, field)
case "frameworks":
return ec.fieldContext_Organization_frameworks(ctx, field)
case "vendors":
return ec.fieldContext_Organization_vendors(ctx, field)
case "peoples":
return ec.fieldContext_Organization_peoples(ctx, field)
case "createdAt":
return ec.fieldContext_Organization_createdAt(ctx, field)
case "updatedAt":
return ec.fieldContext_Organization_updatedAt(ctx, field)
}
return nil, fmt.Errorf("no field named %q was found under type Organization", field.Name)
},
}
return fc, nil
}
func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) { func (ec *executionContext) ___Directive_name(ctx context.Context, field graphql.CollectedField, obj *introspection.Directive) (ret graphql.Marshaler) {
fc, err := ec.fieldContext___Directive_name(ctx, field) fc, err := ec.fieldContext___Directive_name(ctx, field)
if err != nil { if err != nil {
@@ -11752,6 +11983,23 @@ func (ec *executionContext) _Query(ctx context.Context, sel ast.SelectionSet) gr
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
} }
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "viewer":
field := field
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
res = ec._Query_viewer(ctx, field)
if res == graphql.Null {
atomic.AddUint32(&fs.Invalids, 1)
}
return res
}
rrm := func(ctx context.Context) graphql.Marshaler {
return ec.OperationContext.RootResolverMiddleware(ctx,
func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) }) out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return rrm(innerCtx) })
case "__type": case "__type":
out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) {
@@ -12319,6 +12567,76 @@ func (ec *executionContext) _VendorEdge(ctx context.Context, sel ast.SelectionSe
return out return out
} }
var viewerImplementors = []string{"Viewer"}
func (ec *executionContext) _Viewer(ctx context.Context, sel ast.SelectionSet, obj *types.Viewer) graphql.Marshaler {
fields := graphql.CollectFields(ec.OperationContext, sel, viewerImplementors)
out := graphql.NewFieldSet(fields)
deferred := make(map[string]*graphql.FieldSet)
for i, field := range fields {
switch field.Name {
case "__typename":
out.Values[i] = graphql.MarshalString("Viewer")
case "id":
out.Values[i] = ec._Viewer_id(ctx, field, obj)
if out.Values[i] == graphql.Null {
atomic.AddUint32(&out.Invalids, 1)
}
case "organization":
field := field
innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) {
res = ec._Viewer_organization(ctx, field, obj)
if res == graphql.Null {
atomic.AddUint32(&fs.Invalids, 1)
}
return res
}
if field.Deferrable != nil {
dfs, ok := deferred[field.Deferrable.Label]
di := 0
if ok {
dfs.AddField(field)
di = len(dfs.Values) - 1
} else {
dfs = graphql.NewFieldSet([]graphql.CollectedField{field})
deferred[field.Deferrable.Label] = dfs
}
dfs.Concurrently(di, func(ctx context.Context) graphql.Marshaler {
return innerFunc(ctx, dfs)
})
// don't run the out.Concurrently() call below
out.Values[i] = graphql.Null
continue
}
out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) })
default:
panic("unknown field " + strconv.Quote(field.Name))
}
}
out.Dispatch(ctx)
if out.Invalids > 0 {
return graphql.Null
}
atomic.AddInt32(&ec.deferred, int32(len(deferred)))
for label, dfs := range deferred {
ec.processDeferredGroup(graphql.DeferredGroup{
Label: label,
Path: graphql.GetPath(ctx),
FieldSet: dfs,
Context: ctx,
})
}
return out
}
var __DirectiveImplementors = []string{"__Directive"} var __DirectiveImplementors = []string{"__Directive"}
func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler { func (ec *executionContext) ___Directive(ctx context.Context, sel ast.SelectionSet, obj *introspection.Directive) graphql.Marshaler {
@@ -13226,6 +13544,20 @@ func (ec *executionContext) marshalNNode2githubᚗcomᚋgetproboᚋproboᚋpkg
return ec._Node(ctx, sel, v) return ec._Node(ctx, sel, v)
} }
func (ec *executionContext) marshalNOrganization2githubᚗcomᚋgetproboᚋproboᚋpkgᚋapiᚋconsoleᚋv1ᚋtypesᚐOrganization(ctx context.Context, sel ast.SelectionSet, v types.Organization) graphql.Marshaler {
return ec._Organization(ctx, sel, &v)
}
func (ec *executionContext) marshalNOrganization2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋapiᚋconsoleᚋv1ᚋtypesᚐOrganization(ctx context.Context, sel ast.SelectionSet, v *types.Organization) graphql.Marshaler {
if v == nil {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
}
return graphql.Null
}
return ec._Organization(ctx, sel, v)
}
func (ec *executionContext) marshalNPageInfo2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋapiᚋconsoleᚋv1ᚋtypesᚐPageInfo(ctx context.Context, sel ast.SelectionSet, v *types.PageInfo) graphql.Marshaler { func (ec *executionContext) marshalNPageInfo2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋapiᚋconsoleᚋv1ᚋtypesᚐPageInfo(ctx context.Context, sel ast.SelectionSet, v *types.PageInfo) graphql.Marshaler {
if v == nil { if v == nil {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
@@ -13701,6 +14033,20 @@ func (ec *executionContext) marshalNVendorEdge2ᚖgithubᚗcomᚋgetproboᚋprob
return ec._VendorEdge(ctx, sel, v) return ec._VendorEdge(ctx, sel, v)
} }
func (ec *executionContext) marshalNViewer2githubᚗcomᚋgetproboᚋproboᚋpkgᚋapiᚋconsoleᚋv1ᚋtypesᚐViewer(ctx context.Context, sel ast.SelectionSet, v types.Viewer) graphql.Marshaler {
return ec._Viewer(ctx, sel, &v)
}
func (ec *executionContext) marshalNViewer2ᚖgithubᚗcomᚋgetproboᚋproboᚋpkgᚋapiᚋconsoleᚋv1ᚋtypesᚐViewer(ctx context.Context, sel ast.SelectionSet, v *types.Viewer) graphql.Marshaler {
if v == nil {
if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) {
ec.Errorf(ctx, "the requested element is null which the schema does not allow")
}
return graphql.Null
}
return ec._Viewer(ctx, sel, v)
}
func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler { func (ec *executionContext) marshalN__Directive2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚋintrospectionᚐDirective(ctx context.Context, sel ast.SelectionSet, v introspection.Directive) graphql.Marshaler {
return ec.___Directive(ctx, sel, &v) return ec.___Directive(ctx, sel, &v)
} }

View File

@@ -314,3 +314,8 @@ type VendorEdge struct {
Cursor page.CursorKey `json:"cursor"` Cursor page.CursorKey `json:"cursor"`
Node *Vendor `json:"node"` Node *Vendor `json:"node"`
} }
type Viewer struct {
ID gid.GID `json:"id"`
Organization *Organization `json:"organization"`
}

View File

@@ -263,6 +263,11 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error
return nil, gqlerror.Errorf("node %q not found", id) return nil, gqlerror.Errorf("node %q not found", id)
} }
// Viewer is the resolver for the viewer field.
func (r *queryResolver) Viewer(ctx context.Context) (*types.Viewer, error) {
return &types.Viewer{}, nil
}
// StateTransisions is the resolver for the stateTransisions field. // StateTransisions is the resolver for the stateTransisions field.
func (r *taskResolver) StateTransisions(ctx context.Context, obj *types.Task, first *int, after *page.CursorKey, last *int, before *page.CursorKey) (*types.TaskStateTransitionConnection, error) { func (r *taskResolver) StateTransisions(ctx context.Context, obj *types.Task, first *int, after *page.CursorKey, last *int, before *page.CursorKey) (*types.TaskStateTransitionConnection, error) {
cursor := types.NewCursor(first, after, last, before) cursor := types.NewCursor(first, after, last, before)
@@ -287,6 +292,17 @@ func (r *taskResolver) Evidences(ctx context.Context, obj *types.Task, first *in
return types.NewEvidenceConnection(page), nil return types.NewEvidenceConnection(page), nil
} }
// Organization is the resolver for the organization field.
func (r *viewerResolver) Organization(ctx context.Context, obj *types.Viewer) (*types.Organization, error) {
organizationID, _ := gid.ParseGID("AZSfP_xAcAC5IAAAAAAltA") // TODO: remove this
organization, err := r.svc.GetOrganization(ctx, organizationID)
if err != nil {
return nil, fmt.Errorf("cannot get organization: %w", err)
}
return types.NewOrganization(organization), nil
}
// Control returns schema.ControlResolver implementation. // Control returns schema.ControlResolver implementation.
func (r *Resolver) Control() schema.ControlResolver { return &controlResolver{r} } func (r *Resolver) Control() schema.ControlResolver { return &controlResolver{r} }
@@ -308,6 +324,9 @@ func (r *Resolver) Query() schema.QueryResolver { return &queryResolver{r} }
// Task returns schema.TaskResolver implementation. // Task returns schema.TaskResolver implementation.
func (r *Resolver) Task() schema.TaskResolver { return &taskResolver{r} } func (r *Resolver) Task() schema.TaskResolver { return &taskResolver{r} }
// Viewer returns schema.ViewerResolver implementation.
func (r *Resolver) Viewer() schema.ViewerResolver { return &viewerResolver{r} }
type controlResolver struct{ *Resolver } type controlResolver struct{ *Resolver }
type evidenceResolver struct{ *Resolver } type evidenceResolver struct{ *Resolver }
type frameworkResolver struct{ *Resolver } type frameworkResolver struct{ *Resolver }
@@ -315,3 +334,4 @@ type mutationResolver struct{ *Resolver }
type organizationResolver struct{ *Resolver } type organizationResolver struct{ *Resolver }
type queryResolver struct{ *Resolver } type queryResolver struct{ *Resolver }
type taskResolver struct{ *Resolver } type taskResolver struct{ *Resolver }
type viewerResolver struct{ *Resolver }