Prisma 1 Forum

Feedback: Schema Extensions Beta

As noted on this thread:

It doesn’t seem to currently be possible to return a array from a schema extension query.

This is a pretty big limitation, as it prevents us from creating new queries that act like the built in ones

2 Likes

I agree with @dankent that it’s currently one of the biggest limitations of SE.

Thanks @przemek, I reached out in a PM!

@dankent, @agartha, could you please create a new feature request for that? :slight_smile:

1 Like
1 Like

I have a concern about the behaviour of npm modules required in functions always being based on the latest version.

What happens if a package update with a breaking change (hopefully with a major version number increase)?

Functions that require that package will potentially break with no warning if they are affected by the breaking change.

I would rather have a consistent environment for functions (especially those being used in production) rather than the very latest version of every package.

Obviously package versions will need to be updated but if only a single version can be supported, I would rather the update was done with some warning in advance to enable us to make sure our functions won’t be taken out by a breaking change.

Maybe each project could have an option for whether to use the latest version or a ‘last update’ version which has a defined update schedule. That way we could keep production projects on the last update version while using the latest version on a test project to check compatibility.

1 Like

Thanks @dankent, I answered in the other thread:

1 Like

Great - a package.json will be even better than my proposed solution.

1 Like

Hi, I would like to be added to the beta. I would like to integrate steam authentication. Thanks.

1 Like

Does the beta support query on a specific Type?

E.g. sum on Cart type.

It would make more sense to provide an optional query type on a specific Type than on the global Query itself.

1 Like

@Jamie_Barton What you mentioned is part of this FR:

Is it possible to have the Schema Extension call back to my own server, not an AWS Lambda end-point?

@phil Sure, you can use the webhook feature to call any external URL :slight_smile:

Hi guys!

I really appreciate everything you’re doing and please count me in for contributing!

@nilan, Would it be possible to also invite me to beta? I’ve been already wrapping up my functions for social auth but can’t extend the schemas on the GUI nor in the console. Thank you very much in advance!

1 Like

I’m trying to follow this tutorial:
https://github.com/graphcool-examples/functions/blob/master/authentication/facebook-authentication/facebook-authentication.js

But it says that cannot query by facebookUserId on the User type

Here is the log:

    {"event":"{\"data\":{\"facebookToken\":\"token\"},\"context\":{\"request\":{\"sourceIp\":\"34.251.184.127\",\"headers\":{},\"httpMethod\":\"post\"},\"auth\":{\"nodeId\":\"ciwo5i2n31vf30101nwua52dz\",\"typeName\":\"Customer\",\"token\":\"token \"},\"sessionCache\":{},\"environment\":{},\"graphcool\":{\"projectId\":\"cj4fak8lvrawf0192i7eufvxo\",\"alias\":null,\"pat\":\"pat\"}}}","logs":["2017-09-08T00:42:31.079Z: {\"id\":\"1609800585757706\"}","2017-09-08T00:42:31.838Z: {\"response\":{\"data\":null,\"errors\":[{\"message\":\"Unknown argument 'facebookUserId' on field 'User' of type 'Query'. Did you mean 'auth0UserId'? (line 3, column 12):\\n      User(facebookUserId: \\\"1609800585757706\\\"){\\n           ^\",\"locations\":[{\"line\":3,\"column\":12}]}],\"status\":200},\"request\":{\"query\":\"\\n    query {\\n      User(facebookUserId: \\\"1609800585757706\\\"){\\n        id\\n      }\\n    }\"}}"],"returnValue":{"error":"An unexpected error occured."}}

I already created the facebookUserId field on my User Schema

Could you post your schema?

Hi guys,

I’m having a similar issue with Rafael’s. Mine is a little different tho, but still related to FB auth:

{\"message\":\"Field 'createUser' argument 'authProvider' of type 'AuthProviderSignupData!' is required but not provided. (line 3, column 9)

After investigating it a little bit, it seems that once one disables the Auth0 extension, some fields / mutations don’t get properly deleted / updated.

Should i post a new issue for this on Git?

Update: or it might also be the fact that I have email + pass auth enabled which also generates the mutation that has authProvider in it. I’ll be trying to integrate both as I’ve got an idea for it and let you know of the result

Now I’m having the exact same problem as you…
Any solutions?

@doriandrn, @Rafael_Ribeiro

All authentication schema extension examples assume that none of the email, Auth0 or Digits integrations are enabled. To be able to use custom authentication, you need to disable all authentication integrations.

Hey @nilan,

Thanks for your quick answer, that made sense immediately and went for integrating my own auth flow for email & pass.
Although, now, after following the guide, whenever I’m triggering singupEmailUser which then calls createUser, confirmToken and confirmExpires fields seem to be missing.

{\"message\":\"Unknown argument 'confirmExpires' on field 'createUser' of type 'Mutation'. Did you mean 'confirmed'? (line 8, column 11):\\n confirmExpires: \\\"2017-09-09T09:01:25.937Z\\\"\\n ^\",\"locations\":[{\"line\":8,\"column\":11}]}],\"status\":200}
{\"message\":\"Unknown argument 'confirmToken' on field 'createUser' of type 'Mutation'. Did you mean 'confirmed'? (line 7, column 11):\\n confirmToken: \\\"......................\\\",\\n ^\",\"locations\":[{\"line\":7,\"column\":11}]}

Hey @nilan,

I’m not sure what’s the workflow to enable schema extensions but if I need special beta access my use case is Spotify and Email auth.

1 Like