How could I tell which version of Parse Server I am running? I looked at my git history. I cloned the parse server example repo on Mar 22, 2021.
This is the repo I cloned:
The API changed in Parse 4.5.0 in order to turn it Relay compliant. There is no generic mutation anymore. You need to create the class beforehand and then use the mutate to create the object: GraphQL API Guide | Parse
Thanks. I looked at the link you said. Where do you enter the X-Parse-Application-Id in playground? // Header { "X-Parse-Application-Id": "APPLICATION_ID", "X-Parse-Master-Key": "MASTER_KEY" // (optional) }
You know that in the curl command, one can specify APPLICATION_ID this way:
curl -X POST
-H “X-Parse-Application-Id: APPLICATION_ID”
-H “Content-Type: application/json”
-d ‘{“score”:123,“playerName”:“Sean Plott”,“cheatMode”:false}’ http://localhost:1337/parse/classes/GameScore
Do I need to specify Application-Id in playground?
Yes. You need to add. But if you spin up playground using parse-server or use the playground built in parse dashboard, the headers are automatically loaded for you.
To supplement @davimacedo comments, you should use Apollo or Relay only if you are set on using GraphQL with the parse server.
Since the Swift SDK you referenced uses REST, you don’t need to do anything special to enable REST on the parse-server, it just works out-of-the box. If you already began writing your client app with the Parse Swift SDK, you should weigh the trade-offs and decode if you want to change it.
Also, you should look for the tradeoffs between the Parse Swift client and the Apollo/Relay clients. The Swift SDK implements most of the REST functionality for the server (that I know of) and designed using the latest Swift and SwiftUI features. Because of this, you will end up finding the Swift SDK easier to use with Swift based OS’s than the other SDKs (if you are familiar with Swift). I don’t know all of the features of GraphQL on the parse-sever, but I would imagine they are not at parity with the REST yet, though Graph may be getting close with all of the development that has been occurring there. I also imagine that with Graph, you have to worry about a lot more on the client side. With the Swift SDK, you don’t think about “REST”, you just code using Parse Objects, Queries, etc. as REST is used under the hood and is agnostic to the developer.
@cbaker6 Thanks for your comments. I actually don’t understand how Apollo works here. It looks like Apollo is a state management tool and I understand it can be used to manage states in the front-end.
I come from front-end background. But how does Apollo fit here? Even if you use Apollo, you still need the Swift SDK, right? Otherwise, how does your swift code communicate with Graghql?
No, if you use the Swift SDK, you don’t need GraphQL, you just add the SDK to your Xcode project via SPM, cocoapods, etc. and you are done.
For Graph, I’m no expert and @davimacedo can provide better explanations than I can, but there are a number of tutorials online that show how to integrate Apollo and use it directly. A detailed one is below:
You don’t need the ParseSwift SDK when using Apollo as it can do everything by itself with it’s own dependencies.
So, do you mean if I use Apollo, I no longer need any Parse client side software? So, Apollo can handle user authentication, push notification and all other functions provided by ParseSwift SDK? If this is true, then Apollo is pretty amazing.
Both are awesome solutions. If, for whatever reason, you prefer to use the GraphQL API, you should go with Apollo Client or Relay or any other third-party GraphQL client. In the case you prefer to use the REST API, ParseSwift SDK is the way to go.
Thanks. But if I choose Apollo, can it handle user authentication, push notification and all other functions as easy as ParseSwift SDK? Apollo is not specifically built for mobile apps. So, I feel it possibly will lack some features ParseSwift SDK provides.