Is there a way to pass in arguments/variables that...
# prisma-whats-new
a
Is there a way to pass in arguments/variables that are not defined in the schema to a mutation so that you can use them in the request pipeline?
you can use an optional dummy field if you need to
a
so just create a "variables" field on the schema then?
h
Yeah, I've been trying that too! Set your field to null, then populate it in your function, then return. @nilan Does the limitation come from Graphcool or Gql? I thought it came from the way gql schema does validation
n
@hvillain well at the moment it's certainly tied to the GraphQL schema validation that happens both client and server side. But we could allow you to extend the schema with those fields directly.
I think the work around is pretty decent though
@amann you can experiment with different stuff here, either you pass all the variables in separately or use a different approach. what kind of variables do you want to include in the mutation?
a
I'm including an access token given by auth0 right now to fetch some things server-side on behalf of the user.. just don't want to save the access token to the DB
As of now I'm just adding a mutationVariables type to the schema and always making sure at the end of the pipeline all the values are cleared so they aren't persisted. How does this stack up to other approaches you've seen?
n
well you can transform the token in
TRANSFORM_ARGUMENT
to be the empty string for example
@amann your approach is exactly what I talked about 🙂 I think it's great for now
😀 1