public void GetSchema() { if (schemaClass == null) { try{ introspection = File.ReadAllText(Application.dataPath + $"\\{name}schema.txt"); } catch { return; } schemaClass = JsonConvert.DeserializeObject <Introspection.SchemaClass>(introspection); if (schemaClass.data.__schema.queryType != null) { queryEndpoint = schemaClass.data.__schema.queryType.name; } if (schemaClass.data.__schema.mutationType != null) { mutationEndpoint = schemaClass.data.__schema.mutationType.name; } if (schemaClass.data.__schema.subscriptionType != null) { subscriptionEndpoint = schemaClass.data.__schema.subscriptionType.name; } } }
void HandleIntrospection() { if (!request.isDone) { return; } EditorApplication.update -= HandleIntrospection; introspection = request.downloadHandler.text; File.WriteAllText(Application.dataPath + $"\\{name}schema.txt", introspection); schemaClass = JsonConvert.DeserializeObject <Introspection.SchemaClass>(introspection); if (schemaClass.data.__schema.queryType != null) { queryEndpoint = schemaClass.data.__schema.queryType.name; } if (schemaClass.data.__schema.mutationType != null) { mutationEndpoint = schemaClass.data.__schema.mutationType.name; } if (schemaClass.data.__schema.subscriptionType != null) { subscriptionEndpoint = schemaClass.data.__schema.subscriptionType.name; } loading = false; }