Skip to content

Commit

Permalink
Remove code from solution/2
Browse files Browse the repository at this point in the history
  • Loading branch information
brunogsa committed Jul 31, 2019
1 parent be26b8f commit 40dc78a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 38 deletions.
13 changes: 3 additions & 10 deletions resolvers/candidate.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
const {
getAllCandidates,
getCandidateById,
} = require('../services/candidates');

const resolver = {
Query: {
candidates: () => getAllCandidates(),

// TODO candidate: (_, params, req, advancedDetails) => {},
// TODO candidates: () => {},
},

Candidate: {
id: (candidate) => candidate.id,
name: (candidate) => candidate.name,
email: (candidate) => candidate.email,
profession: (candidate) => candidate.profession,
photo: (candidate) => candidate.photo,
following: (candidate) => candidate.following.map(getCandidateById),
id: (candidate) => candidate.id,
// TODO
},
};

Expand Down
12 changes: 3 additions & 9 deletions resolvers/company.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,14 @@ const {
getAllCompanies,
} = require('../services/companies');

const { getJobAdById } = require('../services/jobAds');

const resolver = {
Query: {
companies: () => getAllCompanies(),

// TODO: company: (_, params, req, advancedDetails) => {},
// TODO companies: () => {},
},

Company: {
id: (company) => company.id,
name: (company) => company.name,
photo: (company) => company.photo,
openJobAds: (company) => company.openJobAds.map(getJobAdById),
id: (company) => company.id,
// TODO
},
};

Expand Down
14 changes: 3 additions & 11 deletions resolvers/jobAd.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,14 @@ const {
getAllJobAds,
} = require('../services/jobAds');

const { getCompanyById } = require('../services/companies');

const resolver = {
Query: {
jobAds: () => getAllJobAds(),

// TODO jobAd: (_, params, req, advancedDetails) => {},
// TODO jobAds: () => {},
},

JobAd: {
id: (jobAd) => jobAd.id,
title: (jobAd) => jobAd.title,
description: (jobAd) => jobAd.description,
forCompany: (jobAd) => getCompanyById(jobAd.forCompany),
requiredProfession: (jobAd) => jobAd.requiredProfession,
remainingVacancies: (jobAd) => jobAd.remainingVacancies,
id: (jobAd) => jobAd.id,
// TODO
},
};

Expand Down
11 changes: 3 additions & 8 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,7 @@ type Query {
"""Returns an incredible expected response"""
ping: String!

"""Get all candidates"""
candidates: [Candidate!]!

"""Get all companies"""
companies: [Company!]!

"""Get all job ads"""
jobAds: [JobAd!]!
# TODO candidates
# TODO companies
# TODO jobAds
}

0 comments on commit 40dc78a

Please sign in to comment.