-
Notifications
You must be signed in to change notification settings - Fork 25
Network aggregation search - Initial Config #876
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
Changes from all commits
e326785
5fc6bf7
d8efe90
51f190f
3cc76e9
dc9e8b7
60f93a2
4fa70e3
12be615
892ca74
514e375
4b50e5a
18630ae
e3b5fbf
578f5b2
b660880
a04db5b
5da7740
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| lerna-debug.log | ||
| .groovylintrc.json | ||
| .vscode/*.log | ||
| .vscode/launch.json | ||
|
|
||
| **/dist | ||
| **/node_modules | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,3 +18,9 @@ Build (required before publish): | |
| ``` | ||
| npm run prepare | ||
| ``` | ||
|
|
||
| ## Federated Search | ||
|
|
||
| ### Config | ||
|
|
||
| [Placeholder] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "network": { | ||
| "servers": [ | ||
| { | ||
| "displayName": "Toronto", | ||
| "graphqlUrl": "http://.../graphql", | ||
| "documentType": "file" | ||
| } | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,10 +4,11 @@ import { Router } from 'express'; | |
| import expressPlayground from 'graphql-playground-middleware-express'; | ||
|
|
||
| import getConfigObject, { initializeSets } from './config'; | ||
| import { DEBUG_MODE, ES_USER, ES_PASS } from './config/constants'; | ||
| import { DEBUG_MODE, ENABLE_NETWORK_AGGREGATION, ES_PASS, ES_USER } from './config/constants'; | ||
| import { ConfigProperties } from './config/types'; | ||
| import { addMappingsToTypes, extendFields, fetchMapping } from './mapping'; | ||
| import { extendColumns, extendFacets, flattenMappingToFields } from './mapping/extendMapping'; | ||
| import { createSchemaFromNetworkConfig, mergeSchemas } from './network'; | ||
| import makeSchema from './schema'; | ||
|
|
||
| const getESMapping = async (esClient, index) => { | ||
|
|
@@ -249,19 +250,35 @@ export const createSchemasFromConfigs = async ({ | |
| configsFromFiles, | ||
| ); | ||
|
|
||
| const commonFields = { fieldsFromMapping, typesWithMappings }; | ||
|
|
||
| const { mockSchema, schema } = await createSchema({ | ||
| enableAdmin, | ||
| getServerSideFilter, | ||
| graphqlOptions, | ||
| types: typesWithMappings, | ||
| }); | ||
|
|
||
| return { | ||
| fieldsFromMapping, | ||
| mockSchema, | ||
| schema, | ||
| typesWithMappings, | ||
| }; | ||
| if (false) { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. temp until profile config is added |
||
| const { networkSchema } = await createSchemaFromNetworkConfig({ | ||
| networkConfig: configsFromFiles[ConfigProperties.NETWORK_AGGREGATION], | ||
| }); | ||
| const [mergedSchema, mergedMockSchema] = mergeSchemas({ | ||
| local: { schema, mockSchema }, | ||
| network: { schema: networkSchema, mockSchema: networkMockSchema }, | ||
| }); | ||
| return { | ||
| ...commonFields, | ||
| schema: mergedSchema, | ||
| mockSchema: mergedMockSchema, | ||
| }; | ||
| } else { | ||
| return { | ||
| ...commonFields, | ||
| mockSchema, | ||
| schema, | ||
| }; | ||
| } | ||
|
Comment on lines
+270
to
+281
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. personally preferring the readability of verbose returns and keeping variables as |
||
| } catch (error) { | ||
| const message = error?.message || error; | ||
| console.info('\n------\nError thrown while creating the GraphQL schemas.'); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { NetworkAggregationInterface } from '@/config/types'; | ||
|
|
||
| export const createSchemaFromNetworkConfig = ({ | ||
| networkConfig, | ||
| }: { | ||
| networkConfig: NetworkAggregationInterface[]; | ||
| }) => { | ||
| console.log('network config', networkConfig); | ||
| }; | ||
| export const mergeSchemas = () => {}; | ||
|
Comment on lines
+1
to
+10
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. placeholders. |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
failure can be empty file