Repository: graphql-python/graphene

Issue:
Incorrectly formatted error message.
The error message generated here is incorrect. It should be `only_type._meta.name` instead of `graphene_type._meta.name`. This way the expected value will be reported, which is what the message says it is.

https://github.com/graphql-python/graphene/blob/7bd77a0817677656e2ed8e8ac235ab5e8d557487/graphene/relay/node.py#L105

Also, it's better to use "a" instead of "an" as a default preposition in messages. https://github.com/graphql-python/graphene/blob/7bd77a0817677656e2ed8e8ac235ab5e8d557487/graphene/relay/node.py#L104

Discussion:

Patch:
diff --git a/graphene/relay/node.py b/graphene/relay/node.py
index 6596757..5c787ff 100644
--- a/graphene/relay/node.py
+++ b/graphene/relay/node.py
@@ -101,8 +101,8 @@ class Node(AbstractNode):
 
         if only_type:
             assert graphene_type == only_type, (
-                'Must receive an {} id.'
-            ).format(graphene_type._meta.name)
+                'Must receive a {} id.'
+            ).format(only_type._meta.name)
 
         # We make sure the ObjectType implements the "Node" interface
         if cls not in graphene_type._meta.interfaces:


Test patch:
diff --git a/graphene/relay/tests/test_node.py b/graphene/relay/tests/test_node.py
index 10dc5d9..df44fcb 100644
--- a/graphene/relay/tests/test_node.py
+++ b/graphene/relay/tests/test_node.py
@@ -115,7 +115,7 @@ def test_node_field_only_type_wrong():
         '{ onlyNode(id:"%s") { __typename, name } } ' % Node.to_global_id("MyOtherNode", 1)
     )
     assert len(executed.errors) == 1
-    assert str(executed.errors[0]) == 'Must receive an MyOtherNode id.'
+    assert str(executed.errors[0]) == 'Must receive a MyNode id.'
     assert executed.data == {'onlyNode': None}
 
 
@@ -132,7 +132,7 @@ def test_node_field_only_lazy_type_wrong():
         '{ onlyNodeLazy(id:"%s") { __typename, name } } ' % Node.to_global_id("MyOtherNode", 1)
     )
     assert len(executed.errors) == 1
-    assert str(executed.errors[0]) == 'Must receive an MyOtherNode id.'
+    assert str(executed.errors[0]) == 'Must receive a MyNode id.'
     assert executed.data == {'onlyNodeLazy': None}