From 6646391558a898d511ae8a5e9a8a1d7ce912c93c Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 27 Apr 2021 16:51:58 +0200 Subject: [PATCH] Cleanup fragmentTypes Signed-off-by: Thomas Citharel --- js/fragmentTypes.json | 47 +++++++++++++++++++++++++++++++++++++++++- js/src/apollo/utils.ts | 22 ++------------------ 2 files changed, 48 insertions(+), 21 deletions(-) diff --git a/js/fragmentTypes.json b/js/fragmentTypes.json index daad1c6b3..649592581 100644 --- a/js/fragmentTypes.json +++ b/js/fragmentTypes.json @@ -5,17 +5,50 @@ "kind": "INTERFACE", "name": "ActionLogObject", "possibleTypes": [ + { + "name": "Comment" + }, { "name": "Event" }, { - "name": "Comment" + "name": "Person" }, { "name": "Report" }, { "name": "ReportNote" + }, + { + "name": "User" + } + ] + }, + { + "kind": "INTERFACE", + "name": "ActivityObject", + "possibleTypes": [ + { + "name": "Comment" + }, + { + "name": "Discussion" + }, + { + "name": "Event" + }, + { + "name": "Group" + }, + { + "name": "Member" + }, + { + "name": "Post" + }, + { + "name": "Resource" } ] }, @@ -33,6 +66,18 @@ "name": "Application" } ] + }, + { + "kind": "INTERFACE", + "name": "Interactable", + "possibleTypes": [ + { + "name": "Event" + }, + { + "name": "Group" + } + ] } ] } diff --git a/js/src/apollo/utils.ts b/js/src/apollo/utils.ts index c94e5bd08..92cdcd585 100644 --- a/js/src/apollo/utils.ts +++ b/js/src/apollo/utils.ts @@ -6,28 +6,10 @@ import { AUTH_ACCESS_TOKEN, AUTH_REFRESH_TOKEN } from "@/constants"; import { REFRESH_TOKEN } from "@/graphql/auth"; import { saveTokenData } from "@/utils/auth"; import { ApolloClient } from "apollo-client"; +import introspectionQueryResultData from "../../fragmentTypes.json"; export const fragmentMatcher = new IntrospectionFragmentMatcher({ - introspectionQueryResultData: { - __schema: { - types: [ - { - kind: "UNION", - name: "SearchResult", - possibleTypes: [ - { name: "Event" }, - { name: "Person" }, - { name: "Group" }, - ], - }, - { - kind: "INTERFACE", - name: "Actor", - possibleTypes: [{ name: "Person" }, { name: "Group" }], - }, - ], - }, - }, + introspectionQueryResultData, }); export async function refreshAccessToken(