Difference and example of Directives in FIELD and FIELD_DEFINITION

Like the title, I know the difference is the position of the directives, but my question is exists other difference? or advantage?

Upvotes: 0

Views: 287

Answers (1)

Daniel Rearden
Daniel Rearden

Reputation: 84697

A FIELD directive is used client-side.

query {
  someField @someDirective
}

A FIELD_DEFINITION directive is used server-side.

type Query {
  someField: String @someDirective
}

Server-side directives affect how a schema is initially created. Client-side directives modify how an individual operation is executed.

Upvotes: 2

Related Questions