Sha256: e69d05b6299834803f52ddc59ce23161a9292d1942d9189e662257fdd7fc9b7d

Contents?: true

Size: 711 Bytes

Versions: 19

Compression:

Stored size: 711 Bytes

Contents

# frozen_string_literal: true
require "spec_helper"
require "generators/graphql/mutation_generator"

class GraphQLGeneratorsMutationGeneratorTest < BaseGeneratorTest
  tests Graphql::Generators::MutationGenerator

  test "it generates an empty resolver by name" do
    run_generator(["UpdateName"])

    expected_content = <<-RUBY
Mutations::UpdateName = GraphQL::Relay::Mutation.define do
  name "UpdateName"
  # TODO: define return fields
  # return_field :post, Types::PostType

  # TODO: define arguments
  # input_field :name, !types.String

  resolve ->(obj, args, ctx) {
    # TODO: define resolve function
  }
end
RUBY

    assert_file "app/graphql/mutations/update_name.rb", expected_content
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
graphql-1.6.4 spec/generators/graphql/mutation_generator_spec.rb
graphql-1.5.15 spec/generators/graphql/mutation_generator_spec.rb
graphql-1.6.3 spec/generators/graphql/mutation_generator_spec.rb
graphql-1.6.2 spec/generators/graphql/mutation_generator_spec.rb
graphql-1.6.1 spec/generators/graphql/mutation_generator_spec.rb
graphql-1.6.0 spec/generators/graphql/mutation_generator_spec.rb
graphql-1.5.14 spec/generators/graphql/mutation_generator_spec.rb
graphql-1.5.13 spec/generators/graphql/mutation_generator_spec.rb
graphql-1.5.7.1 spec/generators/graphql/mutation_generator_spec.rb
graphql-1.5.12 spec/generators/graphql/mutation_generator_spec.rb
graphql-1.5.11 spec/generators/graphql/mutation_generator_spec.rb
graphql-1.5.10 spec/generators/graphql/mutation_generator_spec.rb
graphql-1.5.9 spec/generators/graphql/mutation_generator_spec.rb
graphql-1.5.8 spec/generators/graphql/mutation_generator_spec.rb
graphql-1.5.7 spec/generators/graphql/mutation_generator_spec.rb
graphql-1.5.6 spec/generators/graphql/mutation_generator_spec.rb
graphql-1.5.5 spec/generators/graphql/mutation_generator_spec.rb
graphql-1.5.4 spec/generators/graphql/mutation_generator_spec.rb
graphql-1.5.3 spec/generators/graphql/mutation_generator_spec.rb