Skip to content

Instantly share code, notes, and snippets.

@gmac
Last active March 8, 2026 02:48
Show Gist options
  • Select an option

  • Save gmac/15cd52ea5d6836bc976b9e5b01067ecd to your computer and use it in GitHub Desktop.

Select an option

Save gmac/15cd52ea5d6836bc976b9e5b01067ecd to your computer and use it in GitHub Desktop.
# DEPTH RESOLVER (receive and return one)
def resolve(object, args, context)
object["item"]
end
# BREADTH RESOLVER (receive and return many)
def resolve(objects, args, context)
objects.map { |object| object["item"] }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment