add ClientRequest model for apollo-client

This commit is contained in:
Erik Krogh Kristensen
2021-02-11 17:49:44 +01:00
parent 02578cfff2
commit 6f405635ef
3 changed files with 66 additions and 0 deletions

View File

@@ -1,4 +1,10 @@
test_ClientRequest
| apollo.js:5:18:5:78 | new cre ... hql' }) |
| apollo.js:10:1:10:54 | new Htt ... hql' }) |
| apollo.js:14:16:14:69 | new Apo ... .com'}) |
| apollo.js:17:1:17:34 | new Pre ... yurl"}) |
| apollo.js:20:1:20:77 | createN ... phql'}) |
| apollo.js:23:1:23:31 | new Web ... wsUri}) |
| tst.js:11:5:11:16 | request(url) |
| tst.js:13:5:13:20 | request.get(url) |
| tst.js:15:5:15:23 | request.delete(url) |
@@ -111,6 +117,12 @@ test_getHost
| tst.js:93:5:93:35 | net.req ... host }) | tst.js:93:29:93:32 | host |
| tst.js:219:5:219:41 | data.so ... Host"}) | tst.js:219:32:219:39 | "myHost" |
test_getUrl
| apollo.js:5:18:5:78 | new cre ... hql' }) | apollo.js:5:44:5:75 | 'https: ... raphql' |
| apollo.js:10:1:10:54 | new Htt ... hql' }) | apollo.js:10:21:10:51 | 'http:/ ... raphql' |
| apollo.js:14:16:14:69 | new Apo ... .com'}) | apollo.js:14:39:14:67 | 'https: ... le.com' |
| apollo.js:17:1:17:34 | new Pre ... yurl"}) | apollo.js:17:26:17:32 | "myurl" |
| apollo.js:20:1:20:77 | createN ... phql'}) | apollo.js:20:30:20:75 | 'https: ... raphql' |
| apollo.js:23:1:23:31 | new Web ... wsUri}) | apollo.js:23:25:23:29 | wsUri |
| tst.js:11:5:11:16 | request(url) | tst.js:11:13:11:15 | url |
| tst.js:13:5:13:20 | request.get(url) | tst.js:13:17:13:19 | url |
| tst.js:15:5:15:23 | request.delete(url) | tst.js:15:20:15:22 | url |

View File

@@ -0,0 +1,23 @@
import { ApolloClient } from 'apollo-client'
import { HttpLink } from 'apollo-link-http'
import { createHttpLink } from 'apollo-link-http'
const httpLink = new createHttpLink({ uri: 'https://api.github.com/graphql' }) // url 1
const ApolloClient = require('apollo-client-preset').ApolloClient;
const HttpLink = require('apollo-link-http').HttpLink;
new HttpLink({ uri: 'http://localhost:8080/graphql' }); // url 2
import ApolloClient from 'apollo-boost'; // / 'apollo-client'
const client = new ApolloClient({uri: 'https://graphql.example.com'}); // url 3
let PresetHttpLink = require('apollo-client-preset').HttpLink;
new PresetHttpLink({uri: "myurl"}); // url 4
import { createNetworkInterface } from 'apollo-client';
createNetworkInterface({uri: 'https://web-go-demo.herokuapp.com/__/graphql'}) // url 5
const { WebSocketLink } = require('apollo-link-ws')
new WebSocketLink({uri: wsUri}) // url 6