``` 1. frontend.js: post(file) to graphCool.resolv...
# prisma-whats-new
Copy code
1. frontend.js: post(file) to graphCool.resolver(file)
2. graphcool.resolver(): post to cloudinary (keys are hidden)
3. do any other updates (if needed)
4. return { cloudinary_url }
I don’t like that “outdated” string in url path
I did. However, it’s been moved to an
folder, so wasn’t sure if that still works. Also, this still exposes cloudinary’s keys in the front-end.
Since my app is serverless (hence why using graph.cool as BaaS) I want to make sure that my front-end does not contain any API-keys
Using a resolver would make sense. Upload a file to the resolver, let it do its thing… and return back to the app. But wanted to check if anyone did a similar approach. 😊
You cannot upload a file to a resolver
Because you can only call it using a GraphQL query/mutation
It's in the outdated folder because the file and folder structure are incompatible with the
graphcool add-template
@agartha what would be the solution to hide the API keys from the front-end in a serverless app?
@agartha thank you for the clarification on the
folder structure.
I would use a lamdba function to post your file to, so there's no key in the client
@agartha Gotcha. Would you have a resource in handy as to how one creates/uses lambda functions w/GraphCool? 😅
You can have a look at an older file-proxy example I made. Unfortunately, it's also in the outdated folder 😉 https://github.com/graphcool/templates/tree/master/outdated/file-handling/file-proxy It uses Webtask instead of AWS, but the idea is the same
Thank you sir!
I’ll take a look