Closed schickling closed 7 years ago
You have kept the tokenOrRootToken
method, but at the same time, the rename caused the behavior to change, and a single token to be used.
fromEvent
used to set the pat (now rootToken
), api()
used to set to token
when specified in the options. However, there is no rootToken
anywhere. I proposed going forward with one token, but then the tokenOrRootToken
method is no longer needed.
Another question: can you restructure the code so the new createSchema
method goes into a different class? Because now whenever you require graphcool-lib
, you're also pulling all these extra dependencies in (apollo-link-http
, graphql
, graphql-tools
), making this lightweight module a lot heavier then it needs to be, because the createSchema
functionality is very specific, and will never be used in functions.
I like the fact that parameter naming is consistent now. Just token
. However, as generateNodeToken
specifically requires a rootToken, there should be an additional check to see if the provided token is a rootToken or not.
@timsuchanek The release notes don't mention the biggest breaking change: having to specify endpoints manually outside resolver functions!
@kbrandwijk Can you elaborate on that change?
@mwickett Yes, I created https://github.com/graphcool/graphcool-lib/issues/14 for it, but it is already fixed by @timsuchanek.
With many terminology changes being introduced in https://github.com/graphcool/graphcool,
graphcool-lib
also needs to be updated.The following library changes have been introduced:
projectId
toserviceId
pat
torootToken
generateUserToken
togenerateNodeToken
createSchema(): Promise<GraphQLSchema>
to simplify API gateway code (cc @nikolasburk)Changes required from the backend
rootToken
in event context as documented in https://github.com/graphcool/graphcool/issues/219#issuecomment-334938777pat
in event context (this is purely a documentation/communication change)generateUserToken
mutationgenerateNodeToken
mutation with the following schema:Notes
1.x
(see prev point)