Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL: Add draft implementation for directive definition identifiers #668

Merged
merged 2 commits into from
Jan 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/absinthe/language/directive_definition.ex
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ defmodule Absinthe.Language.DirectiveDefinition do
def convert(node, doc) do
%Blueprint.Schema.DirectiveDefinition{
name: node.name,
identifier: Macro.underscore(node.name) |> String.to_atom(),
description: node.description,
arguments: Absinthe.Blueprint.Draft.convert(node.arguments, doc),
directives: Absinthe.Blueprint.Draft.convert(node.directives, doc),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ defmodule Absinthe.Schema.Notation.Experimental.ImportSdlTest do

# Embedded SDL
import_sdl """
directive @feature(name: String!) on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION
directive @another(name: String!) on SCALAR | OBJECT | FIELD_DEFINITION | ARGUMENT_DEFINITION | INTERFACE | UNION | ENUM | ENUM_VALUE | INPUT_OBJECT | INPUT_FIELD_DEFINITION

type Query {
"A list of posts"
posts(filter: PostFilter): [Post]
Expand Down Expand Up @@ -37,11 +40,10 @@ defmodule Absinthe.Schema.Notation.Experimental.ImportSdlTest do
name: String!
}

interface Titled {
interface Titled @feature(name: "bar") {
title: String!
}

scalar A
scalar B

union SearchResult = Post | User
Expand Down