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!
This commit is contained in:
parent
684bf5778f
commit
abc322c24d
1 changed files with 0 additions and 17 deletions
|
@ -25,8 +25,6 @@ const typeDefs = gql`
|
||||||
# This is a convenience field: you could query this from the combination of
|
# This is a convenience field: you could query this from the combination of
|
||||||
# petAppearance and wornItems, but this gets you it in one shot!
|
# petAppearance and wornItems, but this gets you it in one shot!
|
||||||
itemAppearances: [ItemAppearance!]!
|
itemAppearances: [ItemAppearance!]!
|
||||||
|
|
||||||
imageUrl(size: OutfitImageSize): String!
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extend type Query {
|
extend type Query {
|
||||||
|
@ -112,21 +110,6 @@ const resolvers = {
|
||||||
const outfit = await outfitLoader.load(id);
|
const outfit = await outfitLoader.load(id);
|
||||||
return outfit.updatedAt.toISOString();
|
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: {
|
Query: {
|
||||||
|
|
Loading…
Reference in a new issue