lib/rails/graphql/source.rb in rails-graphql-0.1.0 vs lib/rails/graphql/source.rb in rails-graphql-0.1.1
- old
+ new
@@ -143,9 +143,14 @@
# Check if the object was already built
def built?
defined?(@built) && !!@built
end
+ # Checks if a given method can act as resolver
+ def gql_resolver?(method_name)
+ (instance_methods - GraphQL::Source.instance_methods).include?(method_name)
+ end
+
# Attach all defined schema fields into the schemas using the namespaces
# configured for the source
def attach_fields!
refresh_schemas!
schemas.each_value do |schema|