Skip to content

Commit 58cf3b8

Browse files
committed
Cache call to retrieve query string from document
1 parent 57d1ae5 commit 58cf3b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/graphql/query.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def initialize(schema, query_string = nil, query: nil, document: nil, context: n
137137

138138
# If a document was provided to `GraphQL::Schema#execute` instead of the raw query string, we will need to get it from the document
139139
def query_string
140-
@query_string || (document ? document.to_query_string : nil)
140+
@query_string ||= (document ? document.to_query_string : nil)
141141
end
142142

143143
def_delegators :@schema, :interpreter?

0 commit comments

Comments
 (0)