lib/gqli/dsl.rb in gqli-0.6.1 vs lib/gqli/dsl.rb in gqli-1.0.0

- old
+ new

@@ -1,8 +1,9 @@ # frozen_string_literal: true require_relative './query' +require_relative './mutation' require_relative './subscription' require_relative './fragment' require_relative './enum_value' module GQLi @@ -20,10 +21,17 @@ # Can be used at a class level def self.subscription(name = nil, &block) Subscription.new(name, &block) end + # Creates a Mutation object + # + # Can be used at a class level + def self.mutation(name = nil, &block) + Mutation.new(name, &block) + end + # Creates a Fragment object # # Can be used at a class level def self.fragment(name, on, &block) Fragment.new(name, on, &block) @@ -41,12 +49,19 @@ # Can be used at an instance level def query(name = nil, &block) Query.new(name, &block) end + # Creates a Mutation object + # + # Can be used at a instance level + def mutation(name = nil, &block) + Mutation.new(name, &block) + end + # Creates a Subscription object # - # Can be used at a class level + # Can be used at a instance level def subscription(name = nil, &block) Subscription.new(name, &block) end # Creates a Fragment object