Skip to content

AppSync GraphQL API - MissingSchema: Invalid URL Error despite correct endpoint URL provided

0

I am calling my AWS AppSync GraphQL API using Python. The API is hosted on AWS amplify. I have entered my AppSync GraphQL endpoint URL correctly.

However I get the following error when I execute a GraphQL query: MissingSchema: Invalid URL 'None': No scheme supplied. Perhaps you meant https://None?

My code is below, the error occurs for the following line client.execute(gql(list_events_query))

def make_client():
    
    headers = {
        'Accept': 'application/json',
        'Content-Type': 'application/json',
    }

    aws = AWSSession(aws_access_key_id=AWS_ACCESS_KEY_ID,
                     aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
                     region_name=AWS_REGION_NAME)
                     
    credentials = aws.get_credentials().get_frozen_credentials()

    auth = AWS4Auth(
        credentials.access_key,
        credentials.secret_key,
        aws.region_name,
        'appsync',
        session_token=credentials.token,
    )

    transport = RequestsHTTPTransport(url=APPSYNC_ENDPOINT),
                                      headers=headers,
                                      auth=auth)
    
    client = Client(transport=transport,
                    fetch_schema_from_transport=True)
    return client

client = make_client()

resp = client.execute(gql(list_events_query))
1 Answer
0

Hello,

Thank you for reaching out to us.

I see that you are calling AWS AppSync GraphQL API using Python, however you are facing an error "MissingSchema: Invalid URL 'None': No scheme supplied. Perhaps you meant https://None?"

From the error message, it looks like you are specifying the GraphQL endpoint URL incorrectly.

Can you kindly verify and confirm if the GraphQL endpoint URL is being set correctly? You can add a print statement to verify this. The GraphQL endpoint would be in the below format:-

https://abcdefgh12345678.appsync-api.<region>.amazonaws.com/graphql

However, if the issue still persists, we would require further details from your end which are non-public information, like your AppSync API id in order to investigate this issue further. Hence, please open a support case with AWS Premium Support using the below link and kindly share the necessary details so that we can further investigate this issue and find the root cause.

[+] AWS Premium Support: https://aws.amazon.com/premiumsupport/

[+] Create a case: https://support.console.aws.amazon.com/support/home#/case/create

AWS
SUPPORT ENGINEER
answered a year ago
  • Thank you for your response. I can confirm that this is the correct GraphQL endpoint. But the issue still persists

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.