Skip to content

Commit

Permalink
toGraphqlJson updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Schadek committed Jun 27, 2019
1 parent a032bae commit a81e291
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ This graphql implementation is based on June 2018 spec.
- [x] Directives
- [x] Include
- [x] Skip
- [ ] Custom
- [?] Custom (Requires changing the graphqld source)
- [x] Enumerations
- [x] Input Objects
- [x] Mutations
Expand Down
16 changes: 6 additions & 10 deletions source/graphql/uda.d
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,12 @@ template getUdaData(Type) {
}

template getUdaData(Type, string mem) {
//static if(isBuiltinType!(typeof(__traits(getMember, Type, mem)))) {
// enum getUdaData = GQLDUdaData.init;
//} else {
alias GQLDUdaDataAS = getGQLDUdaData!(Type, mem);
static if(GQLDUdaDataAS.length > 0) {
enum getUdaData = GQLDUdaDataAS[0];
} else {
enum getUdaData = GQLDUdaData.init;
}
//}
alias GQLDUdaDataAS = getGQLDUdaData!(Type, mem);
static if(GQLDUdaDataAS.length > 0) {
enum getUdaData = GQLDUdaDataAS[0];
} else {
enum getUdaData = GQLDUdaData.init;
}
}

unittest {
Expand Down
15 changes: 15 additions & 0 deletions source/graphql/validation/schemabased.d
Original file line number Diff line number Diff line change
Expand Up @@ -747,3 +747,18 @@ unittest {

test!void(str);
}

unittest {
string str = `
{
starships {
crew {
... on Humanoid {
doesNotExist
}
}
}
}`;

test!FieldDoesNotExist(str);
}

0 comments on commit a81e291

Please sign in to comment.