• Creates an instance of the SDK Client

    The webSocketImpl parameter is used to inject a custom WebSocket implementation. This is useful for testing purposes, and handling isomorphic environments.

    Parameters

    • __namedParameters: {
          auth?: string;
          cookies?: RequestCookies[];
          fetch?: {
              (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
              (input: string | URL | Request, init?: RequestInit): Promise<Response>;
          };
          host?: string;
          secure?: boolean;
          webSocketImpl?: unknown;
      }
      • Optionalauth?: string

        The API Key to use for authentication. Not needed if using cookies.

      • Optionalcookies?: RequestCookies[]

        Optionally pass in an explicit jwt cookie

      • Optionalfetch?: {
            (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
            (input: string | URL | Request, init?: RequestInit): Promise<Response>;
        }

        A custom fetch implementation. Defaults to the global fetch.

          • (input, init?): Promise<Response>
          • Parameters

            • input: URL | RequestInfo
            • Optionalinit: RequestInit

            Returns Promise<Response>

          • (input, init?): Promise<Response>
          • Parameters

            • input: string | URL | Request
            • Optionalinit: RequestInit

            Returns Promise<Response>

      • Optionalhost?: string

        The host address without the protocol. Defaults to graphql.app.tokens.studio

      • Optionalsecure?: boolean

        Whether to use a secure connection. Defaults to true.

      • OptionalwebSocketImpl?: unknown

    Returns ApolloClient<any>