1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- "use strict";
- const { GraphQLScalarType, GraphQLError } = require("graphql");
- const Upload = require("./Upload.js");
- const GraphQLUpload = new GraphQLScalarType({
- name: "Upload",
- description: "The `Upload` scalar type represents a file upload.",
- parseValue(value) {
- if (value instanceof Upload) return value.promise;
- throw new GraphQLError("Upload value invalid.");
- },
- parseLiteral(node) {
- throw new GraphQLError("Upload literal unsupported.", { nodes: node });
- },
- serialize() {
- throw new GraphQLError("Upload serialization unsupported.");
- },
- });
- module.exports = GraphQLUpload;
|