-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export UploadedFile scalar resolver #9
Comments
I got this working by dropping in taion/graphql-type-json. The name is import GraphQLJSON from 'graphql-type-json'
export default {
UploadedFile: GraphQLJSON,
Query: { ... },
Mutation: { ... }
} |
@jaydenseric I agree. Do you want to make a PR? |
Perhaps, I am in the middle of some epic refactoring but might be in a place to look at it sometime in the next few days. The importable resolver might be better placed in HriBB/apollo-upload-network-interface so it does not have to be duplicated for future non-express middleware. Thoughts? |
Yeah I am very busy ATM as well ... will try to update all packages in a batch sometimes soon. I think that scalar should be a part of the server package(s), because it is not needed on the client. Or it could be a part of some external package or even its own package. I was thinking about using lerna for package management and typescript. Check out this issue |
A benefit to keeping it here is the I for one can't stand TypeScript in OSS, it's not real JavaScript and it makes contributing or even understanding the source difficult. A lot of traffic seems to be about fiddling around with types. |
I would love to find out more about this. I've been trying to upload a file for a couple of weeks but no luck. |
@savovs If you're still stuck, you might find apollo-upload-server a little easier to get up and running – you don't have to set up a custom scalar or Multer. |
Step 3 in the instructions, "Add UploadedFile resolver" is too hard to follow.
Pasting the example code into a typical Apollo resolvers.js file wont work because
Kind
is undefined. Where does that come from, how do you import it? And what is thisast
parameter?This looks pretty boilerplate, why not export the scalar resolver for easy setup?
Something like:
In the meantime, I can't work out how to get the resolver to work so any clarification would be super helpful.
The text was updated successfully, but these errors were encountered: