lighthouse icon indicating copy to clipboard operation
lighthouse copied to clipboard

@deprecated already defined in js-graphql plugin Specification.graphql

Open stephenjason89 opened this issue 3 years ago • 2 comments

image image image

I tried to add Specification.graphql to my excludes in .graphqlconfig but it didn't work For now, i just delete the one in schema-directives.graphql

stephenjason89 avatar Mar 25 '22 07:03 stephenjason89

How about we add an option to php artisan lighthouse:ide-helper that allows not generating built-in directives?

spawnia avatar Mar 25 '22 08:03 spawnia

I think that would work. Thank you @spawnia The only thing that is a duplicate for now is the @deprecated If there would be more then an option to php artisan lighthouse:ide-helper is perfect.

Here's the sample generated by the plugin

Specification.graphql

# ------------------------------------------------------------------------------------------------------------------ ###
# Generated by JS GraphQL IntelliJ Plugin.                                                                           ###
# This file contains built-in types of any GraphQL endpoint. Based on the spec at http://graphql.org/                ###
# ------------------------------------------------------------------------------------------------------------------ ###


# Built-in scalars ------------------------------------------------------------------------------------------------- ###

"""
The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache.
The ID type appears in a JSON response as a String; however, it is not intended to be human-readable.
When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.
"""
scalar ID

"""
The String scalar type represents textual data, represented as UTF-8 character sequences.
The String type is most often used by GraphQL to represent free-form human-readable text.
"""
scalar String

"""
The Boolean scalar type represents true or false.
"""
scalar Boolean

"""
The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.
"""
scalar Float

"""
The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.
"""
scalar Int


# Built-in directives ---------------------------------------------------------------------------------------------- ###

"""
The @include directive may be provided for fields, fragment spreads, and inline fragments,
and allows for conditional inclusion during execution as described by the if argument.
"""
directive @include(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT


"""
The @skip directive may be provided for fields, fragment spreads, and inline fragments,
and allows for conditional exclusion during execution as described by the if argument.
"""
directive @skip(if: Boolean!) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT


"""
The @deprecated directive is used within the type system definition language to indicate deprecated portions of a
GraphQL service's schema, such as deprecated fields on a type or deprecated enum values.

Deprecations include a reason for why it is deprecated, which is formatted using Markdown syntax (as specified by CommonMark).
"""
directive @deprecated(reason: String = "No longer supported") on FIELD_DEFINITION | ENUM_VALUE

"""
The @specifiedBy directive is used within the type system definition language
to provide a URL for specifying the behavior of custom scalar definitions.
"""
directive @specifiedBy(url: String!) on SCALAR

# Introspection  --------------------------------------------------------------------------------------------------- ###

type __QueryIntrospectionMeta {
    __schema: __Schema!
    __type(name: String!): __Type
}

type __TypeNameMeta {
    __typename: String!
}

type __Schema {
    types: [__Type!]!
    queryType: __Type!
    mutationType: __Type
    subscriptionType: __Type
    directives: [__Directive!]!
}

type __Type {
    kind: __TypeKind!
    name: String
    description: String

    "OBJECT and INTERFACE only"
    fields(includeDeprecated: Boolean = false): [__Field!]

    "OBJECT only"
    interfaces: [__Type!]

    "INTERFACE and UNION only"
    possibleTypes: [__Type!]

    "ENUM only"
    enumValues(includeDeprecated: Boolean = false): [__EnumValue!]

    "INPUT_OBJECT only"
    inputFields: [__InputValue!]

    "NON_NULL and LIST only"
    ofType: __Type

    "May be non-null for SCALAR only, must be null for the others"
    specifiedBy: String
}

type __Field {
    name: String!
    description: String
    args: [__InputValue!]!
    type: __Type!
    isDeprecated: Boolean!
    deprecationReason: String
}

type __InputValue {
    name: String!
    description: String
    type: __Type!
    defaultValue: String
}

type __EnumValue {
    name: String!
    description: String
    isDeprecated: Boolean!
    deprecationReason: String
}

enum __TypeKind {
    SCALAR,
    OBJECT,
    INTERFACE,
    UNION,
    ENUM,
    INPUT_OBJECT,
    LIST,
    NON_NULL,
}

type __Directive {
    name: String!
    description: String
    isRepeatable: Boolean!
    locations: [__DirectiveLocation!]!
    args: [__InputValue!]!
}

enum __DirectiveLocation {
    QUERY,
    MUTATION,
    SUBSCRIPTION,
    FIELD,
    FRAGMENT_DEFINITION,
    FRAGMENT_SPREAD,
    INLINE_FRAGMENT,
    SCHEMA,
    SCALAR,
    OBJECT,
    FIELD_DEFINITION,
    ARGUMENT_DEFINITION,
    INTERFACE,
    UNION,
    ENUM,
    ENUM_VALUE,
    INPUT_OBJECT,
    INPUT_FIELD_DEFINITION,
    VARIABLE_DEFINITION
}

stephenjason89 avatar Mar 25 '22 08:03 stephenjason89