Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate support module to Server Preset (Part 5) #4956

Merged
merged 1 commit into from
Jul 2, 2024
Merged

Conversation

eddeee888
Copy link
Collaborator

@eddeee888 eddeee888 commented Jun 10, 2024

Background

This PR migrates support module to Server Preset

TODO

Copy link

changeset-bot bot commented Jun 10, 2024

⚠️ No Changeset found

Latest commit: 73056eb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -1,7 +1,7 @@
/* This file was automatically generated. DO NOT UPDATE MANUALLY. */
import type { Resolvers } from './../../__generated__/types.next';
import { Organization } from './resolvers/Organization';
import { Organization as rate_limit_Organization } from './resolvers/Organization';
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rename is expected because other modules are extending type Organization, so server preset adds module name to distinguish them, even if they are not all in one file

codegen.mts Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented Jun 10, 2024

🐋 This PR was built and pushed to the following Docker images (tag: 73056eb3b324c0f2ef8018485341dd12f435d10e):

Docker Bake metadata
{
"app": {
  "buildx.build.ref": "builder-a78cab8b-886d-4cc7-be56-198e17f59ce6/builder-a78cab8b-886d-4cc7-be56-198e17f59ce60/tu9agj4et2y1sqyy9uwqx6mgn",
  "containerimage.descriptor": {
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "digest": "sha256:7dbfc399edb0fc2b4c132068b7f9f615b181b12b9555679590fe8a230093bad2",
    "size": 685
  },
  "containerimage.digest": "sha256:7dbfc399edb0fc2b4c132068b7f9f615b181b12b9555679590fe8a230093bad2",
  "image.name": "ghcr.io/kamilkisiela/graphql-hive/app:73056eb3b324c0f2ef8018485341dd12f435d10e,ghcr.io/kamilkisiela/graphql-hive/app:migrate_modules_5"
},
"composition-federation-2": {
  "buildx.build.ref": "builder-a78cab8b-886d-4cc7-be56-198e17f59ce6/builder-a78cab8b-886d-4cc7-be56-198e17f59ce60/nblfrnjhxskljo3huxb7tqcxb",
  "containerimage.descriptor": {
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "digest": "sha256:b09858f6a382bed61c93c827eb7c7c8299b4edc3bb2de1c9b74a1eac3a74bcb6",
    "size": 685
  },
  "containerimage.digest": "sha256:b09858f6a382bed61c93c827eb7c7c8299b4edc3bb2de1c9b74a1eac3a74bcb6",
  "image.name": "ghcr.io/kamilkisiela/graphql-hive/composition-federation-2:73056eb3b324c0f2ef8018485341dd12f435d10e,ghcr.io/kamilkisiela/graphql-hive/composition-federation-2:migrate_modules_5"
},
"emails": {
  "buildx.build.ref": "builder-a78cab8b-886d-4cc7-be56-198e17f59ce6/builder-a78cab8b-886d-4cc7-be56-198e17f59ce60/vgevn6vm7f916t4h4ek3xyvy2",
  "containerimage.descriptor": {
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "digest": "sha256:4cf50853bf6522af600ba7765253b62241d642034792e8eb1b13e40ae07e345b",
    "size": 685
  },
  "containerimage.digest": "sha256:4cf50853bf6522af600ba7765253b62241d642034792e8eb1b13e40ae07e345b",
  "image.name": "ghcr.io/kamilkisiela/graphql-hive/emails:73056eb3b324c0f2ef8018485341dd12f435d10e,ghcr.io/kamilkisiela/graphql-hive/emails:migrate_modules_5"
},
"policy": {
  "buildx.build.ref": "builder-a78cab8b-886d-4cc7-be56-198e17f59ce6/builder-a78cab8b-886d-4cc7-be56-198e17f59ce60/pddpytc0yr12xyw6td69tfxw0",
  "containerimage.descriptor": {
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "digest": "sha256:5be4c1971f0258ce7496908d7570f58aa7a15854c1716ba457341ec711e0daa2",
    "size": 685
  },
  "containerimage.digest": "sha256:5be4c1971f0258ce7496908d7570f58aa7a15854c1716ba457341ec711e0daa2",
  "image.name": "ghcr.io/kamilkisiela/graphql-hive/policy:73056eb3b324c0f2ef8018485341dd12f435d10e,ghcr.io/kamilkisiela/graphql-hive/policy:migrate_modules_5"
},
"rate-limit": {
  "buildx.build.ref": "builder-a78cab8b-886d-4cc7-be56-198e17f59ce6/builder-a78cab8b-886d-4cc7-be56-198e17f59ce60/0p3gevcwnalncdkx0io3kfvms",
  "containerimage.descriptor": {
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "digest": "sha256:41c01be3abadc407e33bcc9d317388c7a6e66c7b7eaf9d267b0d0f1ced3d105e",
    "size": 685
  },
  "containerimage.digest": "sha256:41c01be3abadc407e33bcc9d317388c7a6e66c7b7eaf9d267b0d0f1ced3d105e",
  "image.name": "ghcr.io/kamilkisiela/graphql-hive/rate-limit:73056eb3b324c0f2ef8018485341dd12f435d10e,ghcr.io/kamilkisiela/graphql-hive/rate-limit:migrate_modules_5"
},
"schema": {
  "buildx.build.ref": "builder-a78cab8b-886d-4cc7-be56-198e17f59ce6/builder-a78cab8b-886d-4cc7-be56-198e17f59ce60/3nejvbqbws8nmp80o91rcskli",
  "containerimage.descriptor": {
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "digest": "sha256:708bf661144450f6bc1197a64755dd65e68f9691e509e636dc9fd01f728b5488",
    "size": 685
  },
  "containerimage.digest": "sha256:708bf661144450f6bc1197a64755dd65e68f9691e509e636dc9fd01f728b5488",
  "image.name": "ghcr.io/kamilkisiela/graphql-hive/schema:73056eb3b324c0f2ef8018485341dd12f435d10e,ghcr.io/kamilkisiela/graphql-hive/schema:migrate_modules_5"
},
"server": {
  "buildx.build.ref": "builder-a78cab8b-886d-4cc7-be56-198e17f59ce6/builder-a78cab8b-886d-4cc7-be56-198e17f59ce60/f9539ue3z1vmwznsw9ugy2wjz",
  "containerimage.descriptor": {
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "digest": "sha256:906cbc1093e0f98bdf5f36a64094be4b1fd5bd8d78c521a67335932542a8f846",
    "size": 685
  },
  "containerimage.digest": "sha256:906cbc1093e0f98bdf5f36a64094be4b1fd5bd8d78c521a67335932542a8f846",
  "image.name": "ghcr.io/kamilkisiela/graphql-hive/server:73056eb3b324c0f2ef8018485341dd12f435d10e,ghcr.io/kamilkisiela/graphql-hive/server:migrate_modules_5"
},
"storage": {
  "buildx.build.ref": "builder-a78cab8b-886d-4cc7-be56-198e17f59ce6/builder-a78cab8b-886d-4cc7-be56-198e17f59ce60/zeddotbghkm9fdo5qcjzgeor5",
  "containerimage.descriptor": {
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "digest": "sha256:25d0f06efd73fb3bd3da847faf0e97c7dd2aba3ee1e45fe10f5de0e0b40f825f",
    "size": 685
  },
  "containerimage.digest": "sha256:25d0f06efd73fb3bd3da847faf0e97c7dd2aba3ee1e45fe10f5de0e0b40f825f",
  "image.name": "ghcr.io/kamilkisiela/graphql-hive/storage:73056eb3b324c0f2ef8018485341dd12f435d10e,ghcr.io/kamilkisiela/graphql-hive/storage:migrate_modules_5"
},
"stripe-billing": {
  "buildx.build.ref": "builder-a78cab8b-886d-4cc7-be56-198e17f59ce6/builder-a78cab8b-886d-4cc7-be56-198e17f59ce60/ccwhzv95tsomrykhjjbs9wfto",
  "containerimage.descriptor": {
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "digest": "sha256:7128029204124205e66b40a9ceda21508adf0f5334ad728b0ed0c59e97dc254a",
    "size": 685
  },
  "containerimage.digest": "sha256:7128029204124205e66b40a9ceda21508adf0f5334ad728b0ed0c59e97dc254a",
  "image.name": "ghcr.io/kamilkisiela/graphql-hive/stripe-billing:73056eb3b324c0f2ef8018485341dd12f435d10e,ghcr.io/kamilkisiela/graphql-hive/stripe-billing:migrate_modules_5"
},
"tokens": {
  "buildx.build.ref": "builder-a78cab8b-886d-4cc7-be56-198e17f59ce6/builder-a78cab8b-886d-4cc7-be56-198e17f59ce60/6ur54dmtlmzpq63qi4q8plfw2",
  "containerimage.descriptor": {
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "digest": "sha256:8cdaa6a34f0b42b5513663914c378a52d3f42769607fd9f9ca7fa5911f087820",
    "size": 685
  },
  "containerimage.digest": "sha256:8cdaa6a34f0b42b5513663914c378a52d3f42769607fd9f9ca7fa5911f087820",
  "image.name": "ghcr.io/kamilkisiela/graphql-hive/tokens:73056eb3b324c0f2ef8018485341dd12f435d10e,ghcr.io/kamilkisiela/graphql-hive/tokens:migrate_modules_5"
},
"usage": {
  "buildx.build.ref": "builder-a78cab8b-886d-4cc7-be56-198e17f59ce6/builder-a78cab8b-886d-4cc7-be56-198e17f59ce60/bwkq3xkc9nib0vnkqn9raubhw",
  "containerimage.descriptor": {
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "digest": "sha256:ef7ec677f5a42ddb02081f466fbdb99099d91c9d18b559e3ad6fc815890bcef5",
    "size": 685
  },
  "containerimage.digest": "sha256:ef7ec677f5a42ddb02081f466fbdb99099d91c9d18b559e3ad6fc815890bcef5",
  "image.name": "ghcr.io/kamilkisiela/graphql-hive/usage:73056eb3b324c0f2ef8018485341dd12f435d10e,ghcr.io/kamilkisiela/graphql-hive/usage:migrate_modules_5"
},
"usage-estimator": {
  "buildx.build.ref": "builder-a78cab8b-886d-4cc7-be56-198e17f59ce6/builder-a78cab8b-886d-4cc7-be56-198e17f59ce60/0e60xf8unku3omjdlqdxanq2n",
  "containerimage.descriptor": {
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "digest": "sha256:c91e748d6ab1c207cca855e2c4516cfcad018a38cc0ea435509dc5b9bd9f7a08",
    "size": 685
  },
  "containerimage.digest": "sha256:c91e748d6ab1c207cca855e2c4516cfcad018a38cc0ea435509dc5b9bd9f7a08",
  "image.name": "ghcr.io/kamilkisiela/graphql-hive/usage-estimator:73056eb3b324c0f2ef8018485341dd12f435d10e,ghcr.io/kamilkisiela/graphql-hive/usage-estimator:migrate_modules_5"
},
"usage-ingestor": {
  "buildx.build.ref": "builder-a78cab8b-886d-4cc7-be56-198e17f59ce6/builder-a78cab8b-886d-4cc7-be56-198e17f59ce60/ek204bzkw6p9fancojytt69aw",
  "containerimage.descriptor": {
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "digest": "sha256:d90be8679e8e72b178e92cc21ff10f1ba218e005747d751f88b268ed53a8f0a4",
    "size": 685
  },
  "containerimage.digest": "sha256:d90be8679e8e72b178e92cc21ff10f1ba218e005747d751f88b268ed53a8f0a4",
  "image.name": "ghcr.io/kamilkisiela/graphql-hive/usage-ingestor:73056eb3b324c0f2ef8018485341dd12f435d10e,ghcr.io/kamilkisiela/graphql-hive/usage-ingestor:migrate_modules_5"
},
"webhooks": {
  "buildx.build.ref": "builder-a78cab8b-886d-4cc7-be56-198e17f59ce6/builder-a78cab8b-886d-4cc7-be56-198e17f59ce60/r86rm0ajjz0rzjpk3ysty06ay",
  "containerimage.descriptor": {
    "mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
    "digest": "sha256:71753bf63cb69189e51d70453964ff39fc5d120527eb813c1b5bdff9e1e1ae11",
    "size": 685
  },
  "containerimage.digest": "sha256:71753bf63cb69189e51d70453964ff39fc5d120527eb813c1b5bdff9e1e1ae11",
  "image.name": "ghcr.io/kamilkisiela/graphql-hive/webhooks:73056eb3b324c0f2ef8018485341dd12f435d10e,ghcr.io/kamilkisiela/graphql-hive/webhooks:migrate_modules_5"
}
}

Comment on lines +5 to +25
comments: async (ticket, _args, { injector }) => {
const response = await injector.get(SupportManager).getTicketComments(ticket.id);

return {
edges: response.nodes.map(comment => ({
node: {
id: String(comment.id),
body: comment.body,
createdAt: comment.created_at,
fromSupport: comment.fromSupport,
},
cursor: String(comment.id),
})),
pageInfo: {
endCursor: String(response.nodes[response.nodes.length - 1]?.id ?? ''),
hasNextPage: response.meta.has_more,
hasPreviousPage: false,
startCursor: String(response.nodes[0]?.id ?? ''),
},
};
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The schema for this type is this:

comments: SupportTicketCommentConnection

This seems a bit different from other *Connection as they are usually non-nullable i.e. *Connection!.
Looking at the implementation, it can never be null. So I think this could be a way to get around having to declare mapper for SupportTicket? 🤔

Either way, this is part of the migration so we should keep the implementation as-is, however, I think we should change the type to SupportTicketCommentConnection! so it correctly reflects the logic.

Unless I misunderstood it, then please let me know!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kamilkisiela Did you think about anything specific when u implemented this?

@eddeee888 eddeee888 marked this pull request as draft June 10, 2024 10:09
@eddeee888 eddeee888 force-pushed the migrate-modules-4 branch 2 times, most recently from 3cd67cf to 56b94fd Compare June 15, 2024 03:06
Base automatically changed from migrate-modules-4 to main June 21, 2024 10:15
@eddeee888 eddeee888 force-pushed the migrate-modules-5 branch 5 times, most recently from 1342738 to 8498bc9 Compare June 30, 2024 12:12
@eddeee888 eddeee888 marked this pull request as ready for review June 30, 2024 12:19
@eddeee888 eddeee888 force-pushed the migrate-modules-5 branch 2 times, most recently from 054dd7b to 6b00207 Compare July 1, 2024 10:53
- Migrate Mutation.supportTicketCreate
- Migrate Mutation.supportTicketReply
- Migrate Organization.supportTickets and Organization.supportTickets
- Migrate SupportTicket
- Migrate SupportTicketPriority and SupportTicketStatus
@eddeee888 eddeee888 force-pushed the migrate-modules-5 branch from 6b00207 to 73056eb Compare July 2, 2024 07:56
@eddeee888 eddeee888 merged commit 3ec08a5 into main Jul 2, 2024
25 checks passed
@eddeee888 eddeee888 deleted the migrate-modules-5 branch July 2, 2024 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants