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/cleanup #913

Draft
wants to merge 26 commits into
base: feature/federated_search
Choose a base branch
from
Draft

Feat/cleanup #913

wants to merge 26 commits into from

Conversation

ciaranschutte
Copy link
Contributor

@ciaranschutte ciaranschutte commented Dec 15, 2024

  • types createConnectionResolvers as a top level TS file so everything below can be typed
  • lots of lovely reusable typing adding eg. GQL Resolver generic
  • removes utils folder dump, created distinct files
  • type duplicates removed and placed with relevant code (Jon, single idea, no haning "types.ts" file)
  • removes __typename distinction in network connected aggregations type, uses singular Aggregation type throughout
  • network
    • standardises language "network" / "remote" -> "node"
    • cleans up dead code
    • simplifies types
    • additional TSDoc

@@ -26,7 +59,7 @@ export default ({ type, getServerSideFilter }) => {
nestedFieldNames,
filters: compileFilter({
clientSideFilter: resolvedFilter,
serverSideFilter: getServerSideFilter(context),
serverSideFilter: getServerSideFilter(),
Copy link
Contributor Author

@ciaranschutte ciaranschutte Dec 15, 2024

Choose a reason for hiding this comment

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

this doesn't appear to be needed? As far as I read, es client is only thing in context and the filter ops shouldn't be used directly in that. thoughts? - Jon, Justin @

tighten config resolver

tighten config resolver
@ciaranschutte ciaranschutte changed the base branch from feature/federated_search to feat/multiple_threshold December 15, 2024 23:50
Base automatically changed from feat/multiple_threshold to feature/federated_search December 16, 2024 22:43
Comment on lines +1 to +24
import { Client } from '@elastic/elasticsearch';
import { GraphQLResolveInfo } from 'graphql';

export type Context = {
esClient: Client;
};

export type ResolverOutput<T> = T | Promise<T>;

/**
* GQL resolver
*
* @param root The parent object of a query.
* @param args The query arguments.
* @param context The context passed to apollo-server for queries.
* @param info The GraphQL info object.
* @return Returns resolved value;
*/
export type Resolver<Root = {}, QueryArgs = Object, ReturnValue = undefined> = (
root: Root,
args: QueryArgs,
context: Context,
info: GraphQLResolveInfo,
) => ResolverOutput<ReturnValue> | ResolverOutput<ReturnValue>;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add reusable GQL resolver type

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.

1 participant