Skip to content

Commit caccb23

Browse files
committed
fix: fully switch from swapi.co to swapi.dev
1 parent c5fbf9d commit caccb23

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
SWAPI GraphQL Wrapper
22
=====================
33

4-
A wrapper around [SWAPI](http://swapi.co) built using GraphQL converting it into [this schema](schema.graphql).
4+
A wrapper around [SWAPI](http://swapi.dev) built using GraphQL converting it into [this schema](schema.graphql).
55

66
Uses:
77

app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "SWAPI GraphQL Wrapper",
3-
"description": "A wrapper around [SWAPI](http://swapi.co) built using GraphQL.",
3+
"description": "A wrapper around [SWAPI](http://swapi.dev) built using GraphQL.",
44
"repository": "https://github.com/graphql/swapi-graphql",
55
"keywords": ["graphql", "swapi", "swapi-graphql"]
66
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "swapi-graphql",
3-
"description": "A GraphQL wrapper for swapi.com",
3+
"description": "A GraphQL wrapper for swapi.devm",
44
"contributors": [
55
"Nicholas Schrock <[email protected]>",
66
"Daniel Schafer <[email protected]>"

src/api/__tests__/local.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ import { getFromLocalUrl } from '../local';
1212

1313
describe('Local API Wrapper', () => {
1414
it('Gets a person', async () => {
15-
const luke = await getFromLocalUrl('https://swapi.co/api/people/1/');
15+
const luke = await getFromLocalUrl('https://swapi.dev/api/people/1/');
1616
expect(luke.name).to.equal('Luke Skywalker');
17-
const threePO = await getFromLocalUrl('https://swapi.co/api/people/2/');
17+
const threePO = await getFromLocalUrl('https://swapi.dev/api/people/2/');
1818
expect(threePO.name).to.equal('C-3PO');
1919
});
2020

2121
it('Gets pages', async () => {
22-
const firstPeople = await getFromLocalUrl('https://swapi.co/api/people/');
22+
const firstPeople = await getFromLocalUrl('https://swapi.dev/api/people/');
2323
expect(firstPeople.results.length).to.equal(10);
2424
expect(firstPeople.results[0].name).to.equal('Luke Skywalker');
2525
const secondPeople = await getFromLocalUrl(
26-
'https://swapi.co/api/people/?page=2',
26+
'https://swapi.dev/api/people/?page=2',
2727
);
2828
expect(secondPeople.results.length).to.equal(10);
2929
expect(secondPeople.results[0].name).to.equal('Anakin Skywalker');
3030
});
3131

3232
it('Gets first page by default', async () => {
33-
const people = await getFromLocalUrl('https://swapi.co/api/people/');
33+
const people = await getFromLocalUrl('https://swapi.dev/api/people/');
3434
expect(people.results.length).to.equal(10);
3535
expect(people.results[0].name).to.equal('Luke Skywalker');
3636
});

src/schema/__tests__/apiHelper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ import {
1717

1818
describe('API Helper', () => {
1919
it('Gets a person', async () => {
20-
const luke = await getObjectFromUrl('https://swapi.co/api/people/1/');
20+
const luke = await getObjectFromUrl('https://swapi.dev/api/people/1/');
2121
expect(luke.name).to.equal('Luke Skywalker');
22-
const threePO = await getObjectFromUrl('https://swapi.co/api/people/2/');
22+
const threePO = await getObjectFromUrl('https://swapi.dev/api/people/2/');
2323
expect(threePO.name).to.equal('C-3PO');
2424
});
2525

src/schema/apiHelper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export async function getObjectFromTypeAndId(
3939
type: string,
4040
id: string,
4141
): Promise<Object> {
42-
return await getObjectFromUrl(`https://swapi.co/api/${type}/${id}/`);
42+
return await getObjectFromUrl(`https://swapi.dev/api/${type}/${id}/`);
4343
}
4444

4545
type ObjectsByType = {
@@ -52,7 +52,7 @@ type ObjectsByType = {
5252
*/
5353
export async function getObjectsByType(type: string): Promise<ObjectsByType> {
5454
let objects = [];
55-
let nextUrl = `https://swapi.co/api/${type}/`;
55+
let nextUrl = `https://swapi.dev/api/${type}/`;
5656
while (nextUrl) {
5757
// eslint-disable-next-line no-await-in-loop
5858
const pageData = await localUrlLoader.load(nextUrl);

0 commit comments

Comments
 (0)