Skip to content

Conversation

yarinvak
Copy link
Member

@yarinvak yarinvak commented Aug 5, 2018

No description provided.

```

The name of the directive will be taken from the ``@GraphQLName`` annotation (if not specified, the name will be the class's name).
The description of the directive will be taken from the ``@GraphQLDescription`` annotation's value.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be -> is

}
```

The name of the directive will be taken from the ``@GraphQLName`` annotation (if not specified, the name will be the class's name).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be -> is

README.md Outdated
The description of the directive will be taken from the ``@GraphQLDescription`` annotation's value.
The valid locations of the directive (locations which the directive can be applied on) will be taken from ``@DirectiveLocations``.
The arguments of the directive will be taken from the fields defined in the class - notice that you can only use primitive types as arguments of a directive.
For example, we defined an ``isActive`` field - which is boolean, and it's default value is true. That's how the argument of the directive will be defined.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's -> its

README.md Outdated
For example, we defined an ``isActive`` field - which is boolean, and it's default value is true. That's how the argument of the directive will be defined.
You can also use ``@GraphQLName`` and ``@GraphQLDescription`` annotations on the field.

After you created the class, you will be able to create the ``GraphQLDirective`` object with the following code:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with -> using

README.md Outdated
}
}
```
This class turns you string field to upper case if the directive argument "isActive" is set to true.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you -> your

if (graphQLNameAnnotation != null) {
return graphQLNameAnnotation.value();
}
if (annotatedElement instanceof Class<?>) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do "else if"



public GraphQLArgument getArgument(Field field, Class<?> containingClass) {
GraphQLArgument.Builder builder = newArgument();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concatenate all the builder's methods

}

public GraphQLDirective getDirective(Class<?> annotatedClass) {
GraphQLDirective.Builder builder = newDirective();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concatenate all the builder's methods

@yarinvak yarinvak merged commit acab5c1 into Enigmatis:master Aug 6, 2018
@yarinvak yarinvak deleted the add-directive-creation branch January 17, 2020 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants