From abc322c24d002d665952784ba4a922b9e14cef20 Mon Sep 17 00:00:00 2001 From: Matchu Date: Wed, 26 May 2021 20:01:03 -0700 Subject: [PATCH] Remove imageUrl from Outfit GQL I'm not sure which image url is better to return from stuff like this, and I don't actually have a use case for it anymore, so let's just clear it out until we need something like it! --- src/server/types/Outfit.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/server/types/Outfit.js b/src/server/types/Outfit.js index d0d95c2..fcfda7c 100644 --- a/src/server/types/Outfit.js +++ b/src/server/types/Outfit.js @@ -25,8 +25,6 @@ const typeDefs = gql` # This is a convenience field: you could query this from the combination of # petAppearance and wornItems, but this gets you it in one shot! itemAppearances: [ItemAppearance!]! - - imageUrl(size: OutfitImageSize): String! } extend type Query { @@ -112,21 +110,6 @@ const resolvers = { const outfit = await outfitLoader.load(id); return outfit.updatedAt.toISOString(); }, - imageUrl: async ({ id }, { size = "SIZE_600" }, { outfitLoader }) => { - const outfit = await outfitLoader.load(id); - - const updatedAtTimestamp = Math.floor( - new Date(outfit.updatedAt).getTime() / 1000 - ); - const sizeNum = size.split("_")[1]; - - return ( - `https://impress-outfit-images.openneo.net/outfits` + - `/${encodeURIComponent(outfit.id)}` + - `/v/${encodeURIComponent(updatedAtTimestamp)}` + - `/${sizeNum}.png` - ); - }, }, Query: {