Skip to content

Commit 960d864

Browse files
feat: redo Warlock Eldritch Invocations (#330)
* feat: redo Warlock Eldritch Invocations * Revert "feat: redo Warlock Eldritch Invocations" This reverts commit 6d0e889. * Make invocations available in GraphQL API * Add invocations to Typescript type and mongoose schema
1 parent a30dd36 commit 960d864

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

src/graphql/resolvers/featureResolver.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ const Feature = {
8484
);
8585
}
8686

87+
if (feature_specific.invocations) {
88+
featureSpecificToReturn.invocations = await FeatureModel.find({
89+
index: { $in: feature_specific.invocations.map(({ index }) => index) },
90+
}).lean();
91+
}
92+
8793
return featureSpecificToReturn;
8894
},
8995
};

src/graphql/typeDefs.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,9 +1060,9 @@ type ExpertiseChoice {
10601060
type FeatureSpecific {
10611061
expertise_options: ExpertiseChoice
10621062
subfeature_options: FeatureChoice
1063+
invocations: [Feature!]
10631064
}
10641065

1065-
# TODO: Add prerequisites, reference, and feature_specific relations
10661066
type Feature {
10671067
index: String!
10681068
name: String!

src/models/feature/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const FeatureSpecific = new Schema({
1313
_id: false,
1414
subfeature_options: Choice,
1515
expertise_options: Choice,
16+
invocations: [APIReference],
1617
});
1718

1819
const Feature = new Schema({

src/models/feature/types.d.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ type Prerequisite = {
77
};
88

99
type FeatureSpecific = {
10-
subfeature_options: Choice;
11-
expertise_options: Choice;
10+
subfeature_options?: Choice;
11+
expertise_options?: Choice;
12+
invocations?: APIReference[];
1213
};
1314

1415
export type Feature = {

0 commit comments

Comments
 (0)