Sumário
This file contains hidden or 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 { object, string, number, ValidationError } from '@hapi/joi'; | |
const schema = object({ | |
searchCode: string() | |
.required() | |
.label('Search code'), | |
id: number().required() | |
}), | |
messages = { | |
'alternatives.all': '{{#label}} does not match all of the required types', |
This file contains hidden or 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 { RemoteGraphQLDataSource } from '@apollo/gateway'; | |
import { fetch, Request, Headers } from 'apollo-server-env'; | |
import { isObject } from '@apollo/gateway/dist/utilities/predicates'; | |
import FormData from 'form-data'; | |
import _ from 'lodash'; | |
export default class FileUploadDataSource extends RemoteGraphQLDataSource { | |
async process(args) { | |
const { request, context } = args; |