Skip to content

Commit c68353c

Browse files
refactor(overmind-graphql): change from url to endpoint
1 parent 29eda11 commit c68353c

File tree

1 file changed

+10
-10
lines changed
  • packages/node_modules/overmind-graphql/src

1 file changed

+10
-10
lines changed

packages/node_modules/overmind-graphql/src/index.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ interface Subscription {
3333
}
3434

3535
type Http = {
36-
url: string;
36+
endpoint: string;
3737
headers?: () => HttpHeaders;
3838
options?: Options;
3939
};
4040

4141
type Ws = {
42-
url: string;
42+
endpoint: string;
4343
params?: () => { [key: string]: string | number | boolean };
4444
};
4545

@@ -112,32 +112,32 @@ export const graphql: <T extends Queries>(
112112
? _http.options.headers
113113
: {};
114114

115-
if (_clients[_http.url]) {
116-
_clients[_http.url].setHeaders(headers);
115+
if (_clients[_http.endpoint]) {
116+
_clients[_http.endpoint].setHeaders(headers);
117117
} else {
118-
_clients[_http.url] = new GraphQLClient(_http.url, {
118+
_clients[_http.endpoint] = new GraphQLClient(_http.endpoint, {
119119
..._http.options,
120120
headers,
121121
});
122122
}
123123

124-
return _clients[_http.url];
124+
return _clients[_http.endpoint];
125125
}
126126

127127
return null;
128128
}
129129

130130
function getWsClient(): PhoenixSocket | null {
131131
if (_ws) {
132-
if (!_wsClients[_ws.url]) {
133-
_wsClients[_ws.url] = withAbsintheSocket.create(
134-
new PhoenixSocket(_ws.url, {
132+
if (!_wsClients[_ws.endpoint]) {
133+
_wsClients[_ws.endpoint] = withAbsintheSocket.create(
134+
new PhoenixSocket(_ws.endpoint, {
135135
params: _ws.params ? _ws.params() : undefined,
136136
})
137137
);
138138
}
139139

140-
return _wsClients[_ws.url];
140+
return _wsClients[_ws.endpoint];
141141
}
142142

143143
return null;

0 commit comments

Comments
 (0)