Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQL Upload support #171

Open
mlaradji opened this issue Jan 25, 2021 · 0 comments
Open

GraphQL Upload support #171

mlaradji opened this issue Jan 25, 2021 · 0 comments

Comments

@mlaradji
Copy link

I'm attempting to use this plugin with Parse Server. I am able to get it working for simple field types. However, the plugin does not seem to work with the FileInfo type, which uses GraphQL upload. To my understanding, support for GraphQL upload can be added through https://github.com/jaydenseric/graphql-upload.

Vuex-orm model

export class Component extends Model {
  static entity = 'component';
  static primaryKey = 'objectId';

  static fields() {
    return {
      objectId: this.string(null),
      name: this.string(null),
      description: this.string(null),
      model: this.attr(null) // this is the FileInfo field
    };
  }
}

Request to Parse server

{
	"operationName": "Components",
	"query": "query Components {\n  components {\n    edges {\n      node {\n        objectId\n        name\n        description\n        model\n        __typename\n      }\n      __typename\n    }\n    __typename\n  }\n}\n",
	"variables": {}
}

Parse server response:

{
	"errors": [
		{
			"message": "Field \"model\" of type \"FileInfo\" must have a selection of subfields. Did you mean \"model { ... }\"?",
			"locations": [
				{
					"line": 8,
					"column": 9
				}
			],
			"extensions": {
				"code": "GRAPHQL_VALIDATION_FAILED",
				"exception": {
					"stacktrace": [
						"GraphQLError: Field \"model\" of type \"FileInfo\" must have a selection of subfields. Did you mean \"model { ... }\"?",
						"    at Object.Field (/parse-server/node_modules/graphql/validation/rules/ScalarLeafsRule.js:40:31)",
						"    at Object.enter (/parse-server/node_modules/graphql/language/visitor.js:323:29)",
						"    at Object.enter (/parse-server/node_modules/graphql/utilities/TypeInfo.js:370:25)",
						"    at visit (/parse-server/node_modules/graphql/language/visitor.js:243:26)",
						"    at Object.validate (/parse-server/node_modules/graphql/validation/validate.js:69:24)",
						"    at validate (/parse-server/node_modules/apollo-server-core/dist/requestPipeline.js:221:34)",
						"    at Object.<anonymous> (/parse-server/node_modules/apollo-server-core/dist/requestPipeline.js:118:42)",
						"    at Generator.next (<anonymous>)",
						"    at fulfilled (/parse-server/node_modules/apollo-server-core/dist/requestPipeline.js:5:58)",
						"    at processTicksAndRejections (internal/process/task_queues.js:93:5)"
					]
				}
			}
		}
	]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant