rails new blog
cd blog
hanami new bookshelf
vim Gemfile # add `hanami`
bundle
vim bookshelf/config/environment.rb # See Note 1
This file contains 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
class FileUploadComponent extends Component{ | |
upload(){ | |
this.props.mutate({ | |
variables: { | |
id, | |
avatar: this.inputFile.files[0] //this is how you send file | |
} | |
}). | |
then(({data}) => { | |
console.log(data) |
This example demonstrates how we can cache the response fragments in graphql-ruby.
Existing solutions only allow caching resolved values but not all the GraphQL machinery (validation, coercion, whatever).
Caching response parts (in case of Ruby, sub-Hashes) is much more efficient.
This file contains 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
require 'logger' | |
require 'byebug' | |
require 'dry/monads' | |
require 'dry/monads/do' | |
require 'dry/matcher/result_matcher' | |
module Dry | |
module Transaction | |
module Steps |
This file contains 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
FROM ruby:3.0-alpine | |
RUN apk add --no-cache --update \ | |
ack \ | |
bash \ | |
build-base \ | |
curl \ | |
git \ | |
htop \ | |
less \ |
OlderNewer