-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: partial schema update #13
base: master
Are you sure you want to change the base?
Conversation
graphqlUtils_test.go
Outdated
combined, err := combineSchemas(` | ||
type Query { | ||
}`, ` | ||
type Query { | ||
hello: String | ||
}`, []Resolver{}) | ||
|
||
assert.Nil(t, err) | ||
assertEqualNoWhitespace(t, `type Query {}`, combined) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will create a mismatch between a local GraphQL schema and remote GraphQL schema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will, in the same way as there's gonna be a mismatch between local function code and remote deployed function code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I think this resource/action should be separated from the structure of the consuming project ie.ch-api.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The structure is already dictated by resolvers_file
. It is completely OK to invoke this action with different resolver files to achieve partial updates. This just ensures that when you do partial updates the schema will be consistent with the resolvers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to clear my point a bit more regarding the schema mismatch in the next comment 👇
I think this option should be named differently Because the resource/action can be used to either update Schema or resolvers or both when enabling this partial update a resolver file should be opted-in and I think this require more documentation to be understood. |
I could do this:
|
Or maybe Example case: DevOps eng: created CI pipeline with Dev: wanted to create a field that resolves to data-source like DynamoDB or any other data-source however this dev wants to create the resolver manually as he/she thinks/wants to use the example message maybe: Field |
Logging it is definitely a good idea. it will complicate it a bit because I'm gonna have to make a full diff of the two schemas and pick only the nodes (and their descendants) that get affected by the resolvers. I'll look into it. The primary use case here is for a case where you don't want to deploy every single resolver in your solution. There are various reasons why you wouldn't want to do that. Our reason is separate AWS lambda versioning. But it could be that you're making a larger change that changes several resources (Like changing dynamodb tables) and you want to ship it incrementally resolver by resolver. There shouldn't really be breaking changes in the schema either way, so in the ideal case, this change is not necessary because you already can ship different resolvers independently. But this ideal case doesn't always hold. Either way. I'll look how I can make it more expressive. |
I think a message says that some fields are not added to the deployed schema because |
No description provided.