MCPcopy Index your code
hub / github.com/parse-community/parse-server / load

Function load

src/GraphQL/loaders/filesMutations.js:62–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60};
61
62const load = parseGraphQLSchema => {
63 const createMutation = mutationWithClientMutationId({
64 name: 'CreateFile',
65 description: 'The createFile mutation can be used to create and upload a new file.',
66 inputFields: {
67 upload: {
68 description: 'This is the new file to be created and uploaded.',
69 type: new GraphQLNonNull(defaultGraphQLTypes.GraphQLUpload),
70 },
71 },
72 outputFields: {
73 fileInfo: {
74 description: 'This is the created file info.',
75 type: new GraphQLNonNull(defaultGraphQLTypes.FILE_INFO),
76 },
77 },
78 mutateAndGetPayload: async (args, context) => {
79 try {
80 const { upload } = args;
81 const { config } = context;
82 return handleUpload(upload, config);
83 } catch (e) {
84 parseGraphQLSchema.handleError(e);
85 }
86 },
87 });
88
89 parseGraphQLSchema.addGraphQLType(createMutation.args.input.type.ofType, true, true);
90 parseGraphQLSchema.addGraphQLType(createMutation.type, true, true);
91 parseGraphQLSchema.addGraphQLMutation('createFile', createMutation, true, true);
92};
93
94export { load, handleUpload };

Callers

nothing calls this directly

Calls 4

handleUploadFunction · 0.85
addGraphQLTypeMethod · 0.80
addGraphQLMutationMethod · 0.80
handleErrorMethod · 0.45

Tested by

no test coverage detected