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

feat: Drop adminClient (2/2) #2375

Merged
merged 15 commits into from
Nov 3, 2023
Merged

Conversation

DafyddLlyr
Copy link
Contributor

@DafyddLlyr DafyddLlyr commented Nov 3, 2023

What does this PR do?

  • Follow on from chore: Drop adminClient (1/2) #2356 - please see this PR for context
  • Removes adminClient from API codebase
  • Does not remove HASURA_GRAPHQL_ADMIN_SECRET from the API codebase, as this is still required for the Hasura Metadata and Schema APIs

@DafyddLlyr DafyddLlyr changed the base branch from main to dp/drop-admin-client-1 November 3, 2023 08:42
Copy link

github-actions bot commented Nov 3, 2023

Removed vultr server and associated DNS entries

@@ -136,14 +146,18 @@ const findAndReplaceInFlow = async (
}

// if matches, proceed with mutation to update flow data
const response = await adminClient.request(
const { client: $client } = getClient();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not massively fond of this syntax but it's somewhat of a solution to this issue - #2297 (comment)

interface PublishedFlows {
flow: {
publishedFlows: {
// TODO: use FlowGraph from planx-core here
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This TODO is intentionally left here - making this change has pretty messy cascading effects that would add a lot of noise to this PR.

I'll make a GitHub issue describing the required change here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Issue logged here - #2405

);

return data.flows_by_pk.published_flows?.[0]?.data;
const mostRecent = flow?.publishedFlows?.[0]?.data;
if (!mostRecent) throw Error(`Published flow not found for flow ${id}`);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Generally we do error catching outside these little request functions but making it once here actually is much cleaner.

Going forward to would be nice to handle this in a much more standardised method - I actually think Apollo has some really nice patterns for this which may be something to consider.

@DafyddLlyr DafyddLlyr requested a review from a team November 3, 2023 12:44
@DafyddLlyr DafyddLlyr marked this pull request as ready for review November 3, 2023 12:45
Copy link
Member

@jessicamcinchak jessicamcinchak left a comment

Choose a reason for hiding this comment

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

Appreciate being able to work through all changes in two separate chunks, thanks!

api.planx.uk/admin/session/summary.test.ts Outdated Show resolved Hide resolved
api.planx.uk/editor/copyFlow.test.ts Outdated Show resolved Hide resolved
@DafyddLlyr DafyddLlyr force-pushed the dp/drop-admin-client-2 branch from d3fbb29 to 60803c6 Compare November 3, 2023 14:47
@DafyddLlyr
Copy link
Contributor Author

Thanks for catching these naming issues!

@DafyddLlyr DafyddLlyr merged commit 7daacc5 into dp/drop-admin-client-1 Nov 3, 2023
10 checks passed
@DafyddLlyr DafyddLlyr deleted the dp/drop-admin-client-2 branch November 3, 2023 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants