Skip to content

Instantly share code, notes, and snippets.

@afhammad
afhammad / authorized_introspection.ex
Last active July 8, 2024 16:33
Disable GraphQL schema introspection in Elixir Absinthe using a plugin
defmodule MyAppWeb.Schema.Middleware.AuthorizedIntrospection do
@moduledoc """
Disable or restrict schema introspection to authorized requests
"""
@behaviour Absinthe.Plugin
@impl Absinthe.Plugin
def before_resolution(%{context: %{admin: true}} = exec), do: exec
def before_resolution(exec) do
@afhammad
afhammad / keybase.md
Created September 14, 2019 08:47
keybase.md

Keybase proof

I hereby claim:

  • I am afhammad on github.
  • I am afhammad (https://keybase.io/afhammad) on keybase.
  • I have a public key ASAMor_20-DwvZeZDVIIlO-2414LW1Hi_9YOLPbNFaXMQwo

To claim this, I am signing this object: