This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const monolith_url: string = process.env.APOLLO_URL | |
const file_manager_url: string = process.env.FILE_MANAGER_URL | |
async function run() { | |
// logic on how extract files from file microservice | |
function getBatchFiles(context) { | |
return function batchFiles(keys: string[]): Promise<Array<{} | null>> { | |
return new Promise(function (resolve, reject) { | |
const query = ` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type FileNode { | |
name: String! | |
size: Int! | |
id: Int! | |
url: String! | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type MessageNode { | |
id: Int! | |
body: String! | |
files: [FileNode!] | |
} | |
type FileNode { | |
id: Int! | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const monolith_url: string = process.env.APOLLO_URL | |
const file_manager_url: string = process.env.FILE_MANAGER_URL | |
async function run() { | |
// logic on how extract files from file microservice | |
function getBatchFiles(context) { | |
return function batchFiles(keys: string[]): Promise<Array<{} | null>> { | |
return new Promise(function (resolve, reject) { | |
// query file microservice here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const monolith_url: string = process.env.APOLLO_URL | |
const file_manager_url: string = process.env.FILE_MANAGER_URL | |
async function run() { | |
// logic on how extract files from file microservice | |
function getBatchFiles(context) { | |
return function batchFiles(keys: string[]): Promise<Array<{} | null>> { | |
return new Promise(function (resolve, reject) { | |
// query file microservice here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {ApolloServer} from 'apollo-server' | |
import {ApolloGateway} from '@apollo/gateway' | |
const monolith_url: string = 'http://monolith:5000/graphql'; | |
const filemanager_url: string = 'http://filemanager:5000/graphql'; | |
const gateway = new ApolloGateway({ | |
serviceList: [ | |
{ name: 'monolith', url: monolith_url }, | |
{ name: 'filemanager', url: filemanager_url }, | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import graphene | |
from graphene import ObjectType, Int, String | |
from graphene_federation import build_schema, key | |
from utils import file_loader # custom data loader | |
@key(fields='id') | |
class FileNode(ObjectType): | |
id = Int(required=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from graphene import ObjectType, Int, List, String, Field, NonNull | |
from graphene_federation import build_schema, extend, external | |
@extend(fields='id') | |
class FileNode(ObjectType): | |
id = external(Int(required=True)) | |
class MessageNode(ObjectType): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from graphene import Schema, ObjectType, Int, String, List, NonNull | |
from utils import file_loader # custom data loader | |
class FileNode(ObjectType): | |
id = Int(required=True) | |
url = String(required=True) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const monolith_url: string = process.env.APOLLO_URL | |
const file_manager_url: string = process.env.FILE_MANAGER_URL | |
async function run() { | |
// logic on how extract files from file microservice | |
function getBatchFiles(context) { | |
return function batchFiles(keys: string[]): Promise<Array<{} | null>> { | |
return new Promise(function (resolve, reject) { | |
const query = ` |
NewerOlder