ASTのキャッシュ
GraphQLのクエリは多くの場合固定文字列なので、メモリにキャッシュするだけでも効果はあるはず
ドキュメントにはないが、
MySchema.execute(document: GraphQL.parse(query))
でいけそう
#parse()
:
https://github.com/rmosolgo/graphql-ruby/blob/master/lib/graphql.rb
#execute()
:
https://github.com/rmosolgo/graphql-ruby/blob/master/lib/graphql/schema.rb
#execute()
の引数は
Query#initialize()
を見ろ、とある
https://github.com/rmosolgo/graphql-ruby/blob/master/lib/graphql/query.rb