resolvers.ts 729 B

12345678910111213141516171819202122232425262728293031
  1. import {
  2. GraphCacheResolvers,
  3. Shortcode,
  4. Team,
  5. TeamInvitation,
  6. WithTypename,
  7. } from "../graphql"
  8. export const resolversDef: GraphCacheResolvers = {
  9. Query: {
  10. team: (_parent, { teamID }, _cache, _info) =>
  11. <WithTypename<Team>>{
  12. __typename: "Team" as const,
  13. id: teamID,
  14. },
  15. user: (_parent, { uid }, _cache, _info) => ({
  16. __typename: "User",
  17. uid,
  18. }),
  19. teamInvitation: (_parent, args, _cache, _info) =>
  20. <WithTypename<TeamInvitation>>{
  21. __typename: "TeamInvitation",
  22. id: args.inviteID,
  23. },
  24. shortcode: (_parent, args, _cache, _info) =>
  25. <WithTypename<Shortcode>>{
  26. __typename: "Shortcode",
  27. id: args.code,
  28. },
  29. },
  30. }