Sha256: 6deaf403e61b1010c497e357f82c91acd7cef03f85631ffc21a353709bc2a0e0
Contents?: true
Size: 766 Bytes
Versions: 5
Compression:
Stored size: 766 Bytes
Contents
# frozen_string_literal: true require "csv" module Decidim module BulletinBoard module Graphql class FileAdapter attr_reader :file_name def initialize(file_name, _options = {}, &) @file_name = file_name end def execute(document:, operation_name: nil, variables: {}, context: {}) body = {} body["query"] = document.to_query_string body["variables"] = variables if variables.any? body["operationName"] = operation_name if operation_name CSV.open(file_name, "a+", col_sep: ";") do |csv| csv << [JSON.generate(body), context[:headers]["Authorization"]] end { "data" => { "vote" => {} } } end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems