Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

Commit

Permalink
fix(datamodel): omit invalid indices
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed Mar 2, 2019
1 parent f70dfa4 commit 0f785e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,19 @@ export default abstract class Renderer {
}
}

protected getValidIndices(type: IGQLType) {
return type.indices.filter(
index => !index.fields.some(f => f.comments.some(c => c.isError)),
)
}

// TODO: Cleanup index rendering.
protected createIndexDirectives(
type: IGQLType,
typeDirectives: IDirectiveInfo[],
) {
if (type.indices.length > 0) {
const validIndices = this.getValidIndices(type)
if (validIndices.length > 0) {
const indexDescriptions: string[] = []
for (const index of type.indices) {
indexDescriptions.push(this.createIndexDirective(index))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ const testNames = fs.readdirSync(
path.join(__dirname, '../__tests__/blackbox/cases'),
)

console.log({ testNames })

async function deployModel(service, stage, datamodel) {
await fetch(`http://localhost:4466/management`, {
method: 'POST',
Expand Down

0 comments on commit 0f785e0

Please sign in to comment.