Switching from hosts to events
This commit is contained in:
1 parent
3cd9329042
commit
563d4433e3
8 files changed
+27
-27
No files matched your search
Generated
+6
-6
@@ -4,10 +4,10 @@
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@advancedalgos/hosts-client": {
|
||||
"@advancedalgos/events-client": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@advancedalgos/hosts-client/-/hosts-client-0.0.1.tgz",
|
||||
"integrity": "sha512-ISFr7RYncgPxsFnnICwhBwm8mUUwc91FjKgtE3UjN+N6JA4nl/lbYbbF6uHc2nbs3cw0ljY6Mgu9abHLiYcGFw==",
|
||||
"resolved": "https://registry.npmjs.org/@advancedalgos/events-client/-/events-client-0.0.1.tgz",
|
||||
"integrity": "sha512-11m7FbrdCq6JacTpUZP+M08819ZkLDEb0ERdp1tREViWU0YSi9pnpooBB0lSdchZdKSjCZAtOzSIBwl1wV8/GQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@material-ui/core": "^3.2.0",
|
||||
@@ -43,9 +43,9 @@
|
||||
}
|
||||
},
|
||||
"@advancedalgos/teams-client": {
|
||||
"version": "0.0.22",
|
||||
"resolved": "https://registry.npmjs.org/@advancedalgos/teams-client/-/teams-client-0.0.22.tgz",
|
||||
"integrity": "sha512-PTcUdoQyl110Yh9nOfiQgAp5RD5O4aSIcxxq/o3S5XI3peOYeoaUc+IG0ZhQGXjhv5YlmNhJhD48/baLxCn90Q==",
|
||||
"version": "0.0.23",
|
||||
"resolved": "https://registry.npmjs.org/@advancedalgos/teams-client/-/teams-client-0.0.23.tgz",
|
||||
"integrity": "sha512-ANye4alnevrrrn2J0/bmNycE+Ru/Kjd1Uicu99rH0agfZSiDHi7l/oNt/GARyYD/BR0yxTZaJVBkl288D6UJbQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@advancedalgos/web-components": "0.0.13",
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@
|
||||
"@advancedalgos/key-vault-client": "^0.0.14",
|
||||
"@advancedalgos/teams-client": "0.0.23",
|
||||
"@advancedalgos/users-client": "^0.0.14",
|
||||
"@advancedalgos/hosts-client": "^0.0.1",
|
||||
"@advancedalgos/events-client": "^0.0.1",
|
||||
"@advancedalgos/web-components": "0.0.13",
|
||||
"@babel/core": "^7.1.2",
|
||||
"autoprefixer": "^9.2.0",
|
||||
|
||||
+3
-3
@@ -15,7 +15,7 @@ import { Header, Footer, Home, Charts, Callback } from './views'
|
||||
|
||||
import Users from '@advancedalgos/users-client'
|
||||
import Teams from '@advancedalgos/teams-client'
|
||||
import Hosts from '@advancedalgos/hosts-client'
|
||||
import Events from '@advancedalgos/events-client'
|
||||
import KeyVault from '@advancedalgos/key-vault-client'
|
||||
|
||||
export const auth = new Auth(
|
||||
@@ -51,8 +51,8 @@ export const MasterApp = () => (
|
||||
render={props => <Teams {...props} auth={auth} />}
|
||||
/>
|
||||
<Route
|
||||
path='/hosts'
|
||||
render={props => <Hosts {...props} auth={auth} />}
|
||||
path='/events'
|
||||
render={props => <Events {...props} auth={auth} />}
|
||||
/>
|
||||
<Route
|
||||
path='/key-vault'
|
||||
|
||||
@@ -26,7 +26,7 @@ import AALogo from '../../assets/advanced-algos/aa-logo-dark.svg'
|
||||
const ChartsLink = props => <Link to='/charts' {...props} />
|
||||
const UsersLink = props => <Link to='/users' {...props} />
|
||||
const TeamsLink = props => <Link to='/teams' {...props} />
|
||||
const HostsLink = props => <Link to='/hosts' {...props} />
|
||||
const EventsLink = props => <Link to='/events' {...props} />
|
||||
const KeyVaultLink = props => <Link to='/key-vault' {...props} />
|
||||
const HomeLink = props => <Link to='/' {...props} />
|
||||
|
||||
@@ -117,7 +117,7 @@ class Header extends Component {
|
||||
<Button component={TeamsLink} color='inherit'>
|
||||
Teams
|
||||
</Button>
|
||||
<Button component={HostsLink} color='inherit'>
|
||||
<Button component={EventsLink} color='inherit'>
|
||||
Hosts
|
||||
</Button>
|
||||
<Button component={KeyVaultLink} color='inherit'>
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
GRAPHQL_API_URL=https://app-api.advancedalgos.net/graphql
|
||||
TEAMS_API_URL=https://teams-api.advancedalgos.net/graphql
|
||||
USERS_API_URL=https://users-api.advancedalgos.net/graphql
|
||||
HOSTS_API_URL=https://hosts-api.advancedalgos.net/graphql
|
||||
EVENTS_API_URL=https://events-api.advancedalgos.net/graphql
|
||||
KEYVAULT_API_URL=https://keyvault-api.advancedalgos.net/graphql
|
||||
|
||||
AUTH0_DOMAIN=auth0-domain
|
||||
|
||||
+6
-6
@@ -8,7 +8,7 @@ import jwksRsa from 'jwks-rsa'
|
||||
import axios from 'axios'
|
||||
|
||||
import { createTransformedRemoteSchema } from './createRemoteSchema'
|
||||
import { teams, hosts } from './links'
|
||||
import { teams, events } from './links'
|
||||
import logger from './logger'
|
||||
|
||||
async function getUserId (authId) {
|
||||
@@ -36,7 +36,7 @@ async function getUserId (authId) {
|
||||
async function run () {
|
||||
const transformedTeamsSchema = await createTransformedRemoteSchema('teams_', process.env.TEAMS_API_URL)
|
||||
const transformedUsersSchema = await createTransformedRemoteSchema('users_', process.env.USERS_API_URL)
|
||||
const transformedHostsSchema = await createTransformedRemoteSchema('hosts_', process.env.HOSTS_API_URL)
|
||||
const transformedEventsSchema = await createTransformedRemoteSchema('events_', process.env.HOSTS_API_URL)
|
||||
const transformedKeyVaultSchema = await createTransformedRemoteSchema('keyVault_', process.env.KEYVAULT_API_URL)
|
||||
|
||||
var schemas = []
|
||||
@@ -52,11 +52,11 @@ async function run () {
|
||||
if (transformedUsersSchema) {
|
||||
schemas.push(transformedUsersSchema)
|
||||
}
|
||||
if (transformedHostsSchema) {
|
||||
schemas.push(transformedHostsSchema)
|
||||
if (transformedEventsSchema) {
|
||||
schemas.push(transformedEventsSchema)
|
||||
if (transformedUsersSchema && transformedTeamsSchema) {
|
||||
schemas.push(hosts.linkSchemaDefs)
|
||||
resolvers = Object.assign(resolvers, hosts.resolver(transformedUsersSchema, transformedTeamsSchema))
|
||||
schemas.push(events.linkSchemaDefs)
|
||||
resolvers = Object.assign(resolvers, events.resolver(transformedUsersSchema, transformedTeamsSchema))
|
||||
}
|
||||
}
|
||||
if (transformedKeyVaultSchema) {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
export const linkSchemaDefs =
|
||||
`
|
||||
extend type hosts_Event {
|
||||
extend type events_Event {
|
||||
host: users_User
|
||||
}
|
||||
extend type hosts_Participant {
|
||||
extend type events_Participant {
|
||||
team: teams_Team
|
||||
}
|
||||
`
|
||||
|
||||
export const resolver = (usersSchema, teamsSchema) => ({
|
||||
hosts_Event: {
|
||||
events_Event: {
|
||||
host: {
|
||||
fragment: `fragment UserFragment on hosts_Event{hostId}`,
|
||||
fragment: `fragment UserFragment on events_Event{hostId}`,
|
||||
resolve (parent, args, context, info) {
|
||||
return info.mergeInfo.delegateToSchema({
|
||||
schema: usersSchema,
|
||||
@@ -24,9 +24,9 @@ export const resolver = (usersSchema, teamsSchema) => ({
|
||||
}
|
||||
}
|
||||
},
|
||||
hosts_Participant: {
|
||||
events_Participant: {
|
||||
team: {
|
||||
fragment: `fragment TeamFragment on hosts_Participant{teamId}`,
|
||||
fragment: `fragment TeamFragment on events_Participant{teamId}`,
|
||||
resolve (parent, args, context, info) {
|
||||
return info.mergeInfo.delegateToSchema({
|
||||
schema: teamsSchema,
|
||||
@@ -1,4 +1,4 @@
|
||||
import teams from './teams'
|
||||
import hosts from './hosts'
|
||||
import events from './events'
|
||||
|
||||
export { teams, hosts }
|
||||
export { teams, events }
|
||||
Reference in new issue
Block a user