Skip to content

Failed to locate schema root node __schema #2719

@hms-tuanpham

Description

@hms-tuanpham

Question.
My project: Android, compileSdkVersion 30, Kotlin language
Use:

  • classpath 'com.apollographql.apollo:apollo-gradle-plugin:2.4.1'
  • implementation("com.apollographql.apollo:apollo-runtime:2.4.1")

This is my schema.json file which I have downloaded from https://***/graphql:

{
  "_queryType": "Query",
  "_mutationType": "Mutation",
  "_subscriptionType": null,
  "_directives": [
    {
      "name": "model",
      "description": "collection in database",
      "locations": [
        "OBJECT"
      ],
      "args": [
        {
          "name": "filters",
          "description": "includes in filters",
          "type": "[String]"
        }
      ]
    },
    {
      "name": "input",
      "description": "convert to input",
      "locations": [
        "OBJECT"
      ],
      "args": [
        {
          "name": "ignores",
          "description": "ignore when create input",
          "type": "[String]"
        },
        {
          "name": "replaceWithId",
          "description": "replace with id",
          "type": "[String]"
        }
      ]
    },
    {
      "name": "cacheControl",
      "description": null,
      "locations": [
        "FIELD_DEFINITION",
        "OBJECT",
        "INTERFACE"
      ],
      "args": [
        {
          "name": "maxAge",
          "description": null,
          "type": "Int"
        },
        {
          "name": "scope",
          "description": null,
          "type": "CacheControlScope"
        }
      ]
    },
    {
      "name": "include",
      "description": "Directs the executor to include this field or fragment only when the `if` argument is true.",
      "locations": [
        "FIELD",
        "FRAGMENT_SPREAD",
        "INLINE_FRAGMENT"
      ],
      "args": [
        {
          "name": "if",
          "description": "Included when true.",
          "type": "Boolean!"
        }
      ]
    },
    {
      "name": "skip",
      "description": "Directs the executor to skip this field or fragment when the `if` argument is true.",
      "locations": [
        "FIELD",
        "FRAGMENT_SPREAD",
        "INLINE_FRAGMENT"
      ],
      "args": [
        {
          "name": "if",
          "description": "Skipped when true.",
          "type": "Boolean!"
        }
      ]
    },
    {
      "name": "deprecated",
      "description": "Marks an element of a GraphQL schema as no longer supported.",
      "locations": [
        "FIELD_DEFINITION",
        "ARGUMENT_DEFINITION",
        "INPUT_FIELD_DEFINITION",
        "ENUM_VALUE"
      ],
      "args": [
        {
          "name": "reason",
          "description": "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",
          "type": "String",
          "defaultValue": "No longer supported"
        }
      ]
    },
    {
      "name": "specifiedBy",
      "description": "Exposes a URL that specifies the behaviour of this scalar.",
      "locations": [
        "SCALAR"
      ],
      "args": [
        {
          "name": "url",
          "description": "The URL that specifies the behaviour of this scalar.",
          "type": "String!"
        }
      ]
    }
  ],
  "astNode": null,
  "_typeMap": {
    "Query": "Query",
    "ID": "ID",
    "Qr": "Qr",
    "String": "String",
    "Entity": "Entity",
    "EventTimeline": "EventTimeline",
    "Html": "Html",
    "Event": "Event",
    "Date": "Date",
    "Loc": "Loc",
    "Int": "Int",
    "QrFilter": "QrFilter",
    "ListMetadata": "ListMetadata",
    "EventTimelineFilter": "EventTimelineFilter",
    "Mutation": "Mutation",
    "createQrInput": "createQrInput",
    "updateQrInput": "updateQrInput",
    "Boolean": "Boolean",
    "createEventTimelineInput": "createEventTimelineInput",
    "EventInput": "EventInput",
    "LocInput": "LocInput",
    "updateEventTimelineInput": "updateEventTimelineInput",
    "__Schema": "__Schema",
    "__Type": "__Type",
    "__TypeKind": "__TypeKind",
    "__Field": "__Field",
    "__InputValue": "__InputValue",
    "__EnumValue": "__EnumValue",
    "__Directive": "__Directive",
    "__DirectiveLocation": "__DirectiveLocation",
    "CacheControlScope": "CacheControlScope",
    "Upload": "Upload"
  },
  "_implementations": {}
}

When I build my Android project, the gradle throw an error:
Failed to parse GraphQL schema introspection query from
Failed to locate schema root node __schema

Please help me. I don't know why the schema.json is wrong?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions