diff --git a/src/client.ts b/src/client.ts index d819bec9ad..d5188a7787 100755 --- a/src/client.ts +++ b/src/client.ts @@ -90,6 +90,9 @@ export class Client { activeOperations = Object.create(null) as ActiveOperations; constructor(opts: ClientOptions) { + if (process.env.NODE_ENV !== 'production' && !opts.url) { + throw new Error('You are creating an urql-client without a url.'); + } this.url = opts.url; this.fetchOptions = opts.fetchOptions; this.fetch = opts.fetch;